开发者

How to make jQuery Mega Menu drop up?

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

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


   var menuleft=($(window).width()-(megamenu.offsetx-$(document).scrollLeft())>megamenu.actualwidth)? megamenu.offsetx : megamenu.offsetx-megamenu.actualwidth+megamenu.anchorwidth //get x coord of menu

   var menutop=megamenu.offsety+megamenu.anchorheight  //get y coord of menu

These two lines (from jkmegamenu.js) assign values which are later used to position the menu when it is shown. menutop is the distance from the top edge of the window, menuleft the distance from the left edge. Playing with how these values are calculated will allow you to display the menu at any old coordinate you please :)

Good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜