Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Drop down menu in top frame going over main frame

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I have a drop down menu in a top frame using divs and layers. I need the menus to stay above the bottom frame. At the mo they hide behind the bottom frame. Please Help.
 
I'm no expert with Javascript! - but heres an idea.

You can show/hide the visibility of the dropdown in the bottom (main) frame like so:

parent.frame[1].layerName.style.visibility= "visible/hidden"

But this is no good, because if the visitor had scrolled down to the bottom of your main frame they would'nt see the drop down. So I added "window.scrollTo" - scrolls back up to the top, where the dropdown is.

So in the top frame...

<script language=&quot;javascript&quot;>
function show(menu) {

frame = &quot;parent.frames[1].&quot;;
eval(frame + menu + &quot;.style.visibility='visible';&quot;);
parent.frames[1].window.scrollTo(0,0); //Scrolls back up
}
function hide(menu) {

frame = &quot;parent.frames[1].&quot;;
eval(frame + menu + &quot;.style.visibility='hidden';&quot;);
parent.frames[1].window.scrollTo(0,0);
}
</script>


and your links that call for the layers...

<a href=&quot;#&quot; onmouseover=&quot;show('Layer1')&quot; onmouseout=&quot;hide('Layer1')&quot;>Blah</a>
<a href=&quot;#&quot; onmouseover=&quot;show('Layer2')&quot; onmouseout=&quot;hide('Layer2')&quot;>Blah</a>
etc....

then in the main frame you have your layers with ID's Layer1,Layer2 etc.. which nead to hide on mouseout.

<div id=&quot;Layer1&quot; style=&quot;postion:absolute; top:0px; left:0px;&quot; onMouseOut=&quot;this.style.visibility='hidden';&quot;>layer content</div>

Maybe a pro could check it over!

Dave.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top