Overflow Hidden/Visible in Banner plugin [closed] - html

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.
Closed 10 years ago.
I am using a wordpress plugin for sliding images and text. This banner has a content area (as all do) where the images which slides are displayed. text and images can be added from back end. Text is allowed to display over the image. I mean the text will show over the image.
What I am trying to do is forcing that text outside that content area so as to show it outside of it.
<div class='uds-bb-slides'>
<!--slide 1-->
<div class='uds-bb-slide'><a href="" class='uds-bb-link'>image source 1</a>
<div class='uds-bb-description uds-undefined' style='top:185px;left:0px;width:270px;height:34px;'>
<div class='uds-bb-description-inside'>this is slide one text</div>
</div>
</div>
<!--slide 2-->
<div class='uds-bb-slide'><a href="" class='uds-bb-link'>image source 2</a>
<div class='uds-bb-description uds-undefined' style='top:185px;left:0px;width:270px;height:34px;'>
<div class='uds-bb-description-inside'>this is slide two text</div>
</div>
</div>
</div>
Above is the plugin output. from the javascript at page load , uds-bb-slides is made overflow:hidden so that the sliding images show within the content do not show outside it.
This is the problem due to which the forced text is not showing. but when in the plugin js file , I make it overflow : visible. text show outside but the banner images does not show only in the content box. Theay comes from the very right and goes to left. I mean it is not showing its animation properly
My question is how I can force the text outside while the image slides show properly.
Plugin Javascript snippet for making uds-bb-slides overflow hidden at page load
b(".uds-bb-slides",h).css({overflow:"hidden"});
Thanks

I'm not sure of what degree of control you have over the markup that is generated, but if it is possible, I would recommend somehow getting the div with class uds-bb-description uds-undefined to be a sibling of .uds-bb-slides, which has the overflow: hidden. You can then try to position it from there.
You could do this by putting both under a wrapper div with position: relative, and set both child div elements to position: absolute so that you can position them relative to the container.
If it is too difficult to change the output markup from the plugin, you could try doing it with JavaScript. jQuery would make this job easier, but would not be absolutely necessary.
The basic idea is to move the text in the DOM so that it is not longer a child of .uds-bb-slides and is therefore not effected by the overflow: hidden.
Edit:
Ahh...I just noticed you have the .uds-bb-slides and .uds-bb-slide classes, and I mistook the second for the first one.
In that case you may need to do some "hacking" to get the result you want. The plugin probably has some JavaScript that handles visibility and movement of the whole .uds-bb-slide elements, which means the text will go with it.
Option 1:
I don't know exactly how you want it to look, but it sounds to me like you want the text to be on the side, but slide in as well just like the images. One thing you could do is have two .uds-bb-slides elements. The first will be the regular one with the images, but now without any text. The second will have only the text without the background image. You can then attach the event that triggers the image to slide, to the event that causes the text to slide.
Say there is a button (I don't know if there actually is one) that you click to slide the image. You can do something like this with jQuery:
// This is jQuery
$('.btnSlideImage').click(function() { // when you slide the image...
$('.btnSlideText').click(); // trigger text slide
});
You might even be able to copy whatever code they use, and just apply it to your second slider for the same event as the first.
The problem with this is that you get that second slider, which may block clicks or have a default background. You may be able to just set the height and width to 0px, and set overflow: visible, so that the text appears. Again, it's difficult to give exact details without knowing what is really going on.
Option 2:
You could write your own text slider and position it in the right spot. It doesn't even have to slide - perhaps a fade will work for you, which may be much easier to do with jQuery, CSS3, or even pure JavaScript.
Then you can attach an event handler to whatever is causing the image to slide like in option 1:
// This is jQuery too
$('#whatever_makes_image_slide').click(function() {
SlideMyText();
});

Related

Text overflow errors in a bound list in html div

I have a set of bound classes inside a div and they appear as distinct objects one beside the other and the content inside the div is overflowing to the next line. I am looking for an approach which would be best suited to handle these text overflows. The two ideas I am contemplating on are:
Using tooltip- so when the mouse hovers on the div the extra content which is overflowing will be displayed and closes by default when the mouse moves away.
scrolling text- I am unsure about this one since like I said the objects are all bound classes and I am not listing them seperately so when I tried applying marquee to it all the headers of the different objects started scrolling as one long line.
This is how the code looks at present (does not contain the tooltip and scroll that I implemented since I reset the code to how it looks originally.
<div class="BoundClass">
<div>
<div style="white-space:normal"><%#Container.DataItem("cClassName")%></div>
</div>
</div>
Could someone please help me with what would be the best approach to handle the text overflows and also the html, css code for it.
Ok, so I have an update. The following code is working for me, the class names are scrolling in their respective divs.
<div class="BoundClass">
<div>
<marquee behavior="scroll" direction="left"><%#Container.DataItem("cClassName")%></marquee>
</div>
</div>
However I want to set a condition where the ONLY the text that overflows will scroll and the text which fits inside the div doesnt.

Buttons, scroll locking, transitions and unusual code error

I'm having trouble with my code with my CSS stylesheet and HTML index coding. I only have one problem and that is my CSS stylesheet isn't letting me place a div class into it. I'm using the free Brackets software which includes syntax highlighting and it's coming up red which is an error. Here is a picture of it:
http://i58.tinypic.com/ju97cl.png
As you can see in that picture, I've boxed around the place where it's disallowing me to place the div class into the stylsheet in white. I've given a working example with the blue box so I'm confused to why it's doing this.
My main question for you today is how do I create buttons directly in the center on the side of my page with CSS or however possible and how to edit these buttons like adding hover animations, visual looks etc? (I'm new to this by the way) Also, I want to lock the scrolling of my page in a certain area like in the picture described:
http://i62.tinypic.com/wmbyw.png
Lastly, I wish to ask how to make my content on the white area transition by sliding to the side for when I click a button to go onto the next page. However possible I would really appreciate if somebody gives me the time for this. Sadly I can't give another image because I don't have 10 reputation. so I hope you can make out what I'm trying to say.
I will be so grateful to anyone who helps me with this.
First off you need to close your .right-menu class with a }.
For effects and animations check out w3schools:
http://www.w3schools.com/css/css3_transitions.asp - transistion property
http://www.w3schools.com/css/css3_animations.asp - animations
Centering in CSS can be done with text-align: center or margin-left:auto; margin-right: auto.
To prevent scrolling of the body do body {overflow:hidden}
For sliding page content refer to my links above or checkout jQuery
http://www.w3schools.com/jquery/jquery_slide.asp

making area of an html page a link

I am working on a webpage with navigation at the top. I was wondering how to make an area of an html page clickable. That way one could click not just on the text in the navigation bar but a general area around the text in order to navigate from page to page. When I keep trying to do it, it generally messes up the divs I already have on the page.
Any help would be appreciated!
Thanks!
If I understood your problem propertly:
Try setup display: block; for your menu text links, + add them padding. Also possible to use width and height
So active link will be not only the text, but also the area around it.
There are only a small set of HTML elements that you can place inside an <a>, and I am guessing none of them is doing the job for you. For example, a div cannot be placed inside an <a>.
In that case, you can use javascript or jQuery to listen for a click on a certain defined area, say a div, on the page and respond to it by changing the address (say by changing window.location.href). This will have the same effect that you are looking for.
Please note though that usability and design ethics demand that a user of your website knows that a certain area is a link and will take you somewhere else before they click it.
I'm assuming by area you mean an entire div? We can use javascript (jQuery) to do this:
$("#mydiv").click(function() {
window.location = 'http://www.google.com'; // redirect here on click
});
<div id="mydiv">
<!-- this area we can click -->
</div>

Stopping the contents of a div section moving

I have a div section, which is full of tags, on a event on the page I shrink the div section BUT if the user tabs into the div section, it moves so that the highlighted <a href> has focus, is there any way to lock a div section that it's contents don't move ?
So for example the code (psuedo not real) I have the following
<div>
<h4>Heading</hv>
Link 1
Link 2
Link 3
</div>
I shrink the div section so that only the h4 is displayed {overflow:hidden}, however the user can then tab to the elements and this scroll so that they are displayed in the the div "window" which is not what I want, so in effect I get <div>Link 1<div> where what I want to remain is <div><h4>heading</h4></div> in effect I want to stop the contents of the div sectio scrolling so that the selected element is displayed. I know that if they press return the selected link will be follow, but I'm not worried about this, just what is displayed
I hope thats cleared, you can see my problem if you go to link text click on the training section on the left and then back tab (shift tab) , the article section above changes.
Thanks
is there any way to lock a div section that it's contents don't move?
Not really*, but you don't really want that anyway. Even if you locked it in place, the invisible links would still accept focus, resulting in a confusing tab behaviour.
(*: short of something horrendous like changing the scrollTop of the overflowing element from JavaScript onfocus. Ugh.)
What you should probably do is put a div around the links, and set its display style to ‘none’ when the links are elided. That way they won't participate in the tabbing order.
From what I can make of your question, you want your div to stay fixed relative to the browser window. If this is the case, it can simply be done by declaring position:absolute for the div.
If you want something else, please clarify your question.

Divs Shift When Content Gets Too Large

I'm experiencing some strange behavior with a project i'm working on:
http://daft.net76.net/yah/
When you click the rules link the entire layout shifts to the left by a pixel or three. I've attributed this to the amount of content in that div, because when you click the 'Scores' link, which has a smaller content height.
The lower div structure looks like the following:
<div id="lowercontent">
<div id="rulesDiv" >
<h1>Rules</h1>
<p>Clicking the roll button rolls the dice. You have 3 rolls per turn.
After rolling you can choose to keep dice through rolls. Click a die to keep it through a turn.
Submit a combination of dice by clicking an option and clicking Score Roll.
To claim yahtzee either click the zee button, or score roll without anything selected.
To claim yahtzee either click the zee button, or score roll without anything selected.
To claim yahtzee either click the zee button, or score roll without anything selected.
To claim yahtzee either click the zee button, or score roll without anything selected.</p>
</div>
<div id="scoresDiv">
<h1>Scores</h1>
<p>1</p>
</div>
<p id="closeTest"><span id="close">close</span></p>
</div>
I'm using jquery functions to swap between the scores and rules.
lowercontent is a fixed width div. The inner rules and scores divs have no width.
Any ideas? Let me know if more detailed css on the divs is needed.
When the Rules div is shown, it is causing the scrollbar to appear. First, its really not a big deal.. I would just leave it alone.
If it really bothers you, add this to your CSS:
html { height: 100% }
body { height: 101% }
This will force a scrollbar to always be present so the layout won't shift.
My original answers are below but the truth is, there's only one good answer to this if you feel you need to do anything at all: modal windows.
A modal window is one that pops to the foreground and needs to be actioned before you can carry on doing what you were doing. You've used one before even if you didn't know the name. One example is an open file dialogue in an application. You have to pick a file or cancel to carry on.
On the web, you can replicate this functionality quite easily. It involves "overlay" over the content to stop the user touching it and the modal box on top of the overlay. Most web-examples shade the overlay to let the user know what has focus.
This fixes your problem because it stops the content getting longer by putting the new content over the old content and therefore the scroll-bar doesn't need to show.
Luckily for you, there are prefab solutions (see the last line of this) but I think the one that will work best for you is Facebox. It's light and sexy and does the job of just showing some information. it doesn't look like you need to get too bogged down in other actions.
Here, at least, it's because the scrollbar on the window pops up.
There are a few ways to fix this but all are pretty hacky or imperfect:
Use a left-aligned design.
On load, if the height is bigger than the computed height of the content (no scroll bar) force the content to create a scrollbar. Compare widths. Deduct half this from your left margin on your content. Yuck!
Manually centre the content using onload and onresize hooks to change the margin on the content. Probably the cleanest and you can leave it on margin:auto just in case. This won't work for IE6 but I guess that's expected.
You can put the content into tabs that the user has to switch between.
Use pop-in modal layers instead of attaching the content to the bottom of the page. I'm thinking something like LightBox but with content instead of images. I think there's probably a script out there that does this with content already.
Edit: See this for more tips on modal windows.