I'm looking at the code from this: http://www.javascriptkit.com/script/script2/jkmegamenu.shtml

I would like to modify the code to make the menu drop up instead of drop down. Can anyone help me with this? Thanks!

1 answer


Hi Cindy,

The answer lies in jkmegamenu.js; specifically the alignmenu function.

The function is called when you mouseover your 'open' menu. It uses the following code to modify the position of menu div:

var menutop=megamenu.offsety+megamenu.anchorheight $menu.css({left:menuleft+"px", top:menutop+"px"})

In particular, check out the menutop. By changing the value of menutop you can change where the top of the menu appears. We don't want to change it to any value, though - we want to change it to the height of the menu. In this case this is easily acquired by calling megamenu.actualheight.

Replacing the following from the above code:


with: top:megamenu.actualheight+megamenu.anchorheight+"px"

Should get you your desired result.


Answered almost 8 years ago by Brian Y.