View Full Version : Switch Content Script IE problem

08-17-2007, 07:01 PM
1) Script Title: Switch Content Script II

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/switchcontent2.htm

3) Describe problem:


I love this script, it works great, but in IE7 when you click and expand the text, it overflows the viewable area and for some reason, the scroll bar does not appear (it works fine in FF). The up and down keys do work, but that's not too helpful for my users. The script is contained in a content div which is styled to overflow:auto; but somehow IE just doesn't seem to pick up on the expanded text as being overflow.

There's a lot of code involved in the page (because I haven't used a separate style sheet - sorry) so here's the url:


I've added 'expand text' comments in the two places where the relevant code is to help people pick it out. I have not altered the two .js files at all, they can be viewed at the script url.

One other small thing - all the table content seems to have vertically aligned to the middle - I have tried adding a style with vertical-align:top; with no effect. I have also tried valigning the entire table (no effect), and valigning separate cells, but nothing will shift the text. Any ideas?

Any help much appreciated!

08-18-2007, 06:48 AM
Strange... the expanding seems to work fine in IE7 for me... moves the text below it down to make room, and appears to wrap the text properly as well. I even minimized and shrunk the width to see if there would be an issue...still worked fine.

08-18-2007, 11:36 AM
Thanks for looking Sliight,

I see what you mean about it moving the text below down, if I expand text from higher up the page, my scrollbar does appear.

But if I only click the lowest text, e.g. 'Charlotte talking about music', with everything else hidden, some of it gets cut off and still no scrollbar! I suppose a dirty fix might be to put some empty table cells in below to force a scrollbar at all times...

Any ideas about the vertical align prob? I've tried everything to get it to align top!

08-18-2007, 01:16 PM
Ooh, fixed the scrollbar issue with this neat piece of code:

Body {
overflow: -moz-scrollbars-vertical;
overflow-x: hidden;
overflow-y: scroll;

Forces a vertical scrollbar but hides the unnecessary horizontal one in both FF and IE. So just the vertical alignment problem left...