Forum Moderators: open

Message Too Old, No Replies

Javascript Drop Downs/iframe Difficulties

JS drop downs do not display over iframe.

         

denimflavored

2:07 am on Jun 30, 2005 (gmt 0)

10+ Year Member



My Google skills seem to fail me, so I'm hoping to find some help here (as I always have before, you wonderful, wonderful people).
On the site I am currently working on, my clients want Javascript drop down menus for navigation. They want an iframe to keep page size to a minimum. However, Javascript menus (as well as CSS menus - don't think I haven't tried) do not show up on top of iframes, since iframes have an "infinite" z-index.
Has anyone found a workaround? I know I can use a scrollable <div>, but those are not Opera compliant. They also do not allow you to use an outer shell for layout with the content on the inside.
Any suggestions would be much appreciated.
Thanks,
denimflavored

wasproject

1:08 pm on Jul 1, 2005 (gmt 0)

10+ Year Member



Hi denimflavored.

I have had a similar problem using a dropdown menu postioned above a frameless scrolling box (created combinig css fixed positioning and a css/javascript hack for IE).
I ended up setting z-index:5 for the dropdown menu and other fixed elements while setting z-index:3 for the scrolling box.
It tested allright in IE, Netscape, Opera and Mozilla.

Hope it works with i-Frames too.

Good luck.

mincklerstraat

1:48 pm on Jul 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I've done similar stuff with things dropping down over iframes by setting the z-index and it works just fine.

However, I have usually had some good reason to use an iframe (not layout - rather, saving bandwith with a huge js menu that's the same all the time, that kind of thing). If I don't, I just use a div with style="overflow: scroll;". I just looked at one of such things I've got in Opera since you noted it there could be issues, and it looks just fine - you find a lot of advice on the web about dealing with older versions of opera, but it seems most operaites keep fairly up-to-date versions, and don't go for eons without updating. 'Old Opera' users would probably amount to less than a quarter of a percent, I'd guess. My version of opera is 7.54 u2 Linux.

Doing things with an iframe require a separate request to the webserver, and make your whole thing more complicated, unless you have very good reasons to use them.