More Info


You are in: home > javascript > drop down menu tutorial >

There is a newer drop-down menu tutorial at:
http://www.aspandjavascript.co.uk/javascript/drop_down_menu_tutorial_version_2/

click here to go to the new drop down menu tutorial

Unfortunately, support can no longer be offered for this tutorial

Cross Browser Drop-down Menus

3. Stay where you're put!

In the previous section we got a DIV (or layer) to pop up when the mouse was put over a link. We now need to make sure it appears where we want it to.

Test this page in Netscape 4.x. You;ll see the pop-up appears right under the link now.

What's changed to make this happen? In the DIV called "myLabel1" (the link that makes the pop-up appear) there's another transparent GIF file called "img". We can use this in Netscape 4.x to tell where the link is on the page (its page co-ordinates) and make the popup appear just under it.

The revised code is below (the functions "getImagePageLeft" and "getImagePageTop" are in the .js file for the menus):

In the next section we'll look at stringing three of these together to make a proper menu system.


<< Part II: Getting Started Part IV: Multiple Menus >>

Get the code:
[Drop-down version] [Side-menu version] [Cascading version]

If you like Javascript Cascading Drop-down Menu ,
please rate it! @ ScriptSearch.com
Rate Our Program
@ HotScripts.com
Rate Our Program
@ AllTheScripts.com





 © James Austin 2002-05 Web site design by James Austin