I downloaded and modified the Mega Menu script from JavaScriptKit.com, and I love their implementation of the mega menu. http://www.javascriptkit.com/script/script2/jkmegamenu.shtml

I need to know how to change the direction of the fade-in menu. It currently appears left to right, and I would like the menu to appear right to left.

Thank you in advance for your time and expertise.

Tony Allentown, PA

Note: Source code located at the above mentioned URL.

2 answers

0
points

I haven't used it and don't have the time until after work to check it out for myself, but on line 29 of the jkmegamenu.js file, there is a "scrollLeft()" call that should be "scrollRight()" to achieve what you want. However, at first glance this script is including jQuery in noconflict() mode. If you are already using jQuery throughout the site you may want to use the MegaMenu jQuery plugin instead of the stand-alone. You can find it here: http://www.geektantra.com/2009/09/jquery-mega-menu/

Answered over 9 years ago by Gary Hepting
  • Note: You might have to adjust positioning of the element after changing the scroll direction. Good luck! Gary Hepting over 9 years ago
  • I did what you said and changed the call to scrollRight(), but that didn't work at all. I noticed that the .JS file contains several references throughout it to 'menuleft'. Maybe it requires too much to change it at this time... Tony Pearson over 9 years ago
  • Gary, thank you so very much. Good advice. I wanted to ask you if both versions use the same classes? I tweaked the JK version and came up with a really nice menu that meets our needs. If I swapped out the .JS files and used the plugin, will it just work? Or will it require all new tweaking? Again, thank you for your time! Tony Pearson over 9 years ago
0
points

The plugin uses the normal jQuery selectors like this:

$(document).ready(function(){
$(".MegaMenuLink").megamenu(".MegaMenuContent", {
    width: "900px"
});

});

Answered over 9 years ago by Gary Hepting
  • I'll set it up tonight if I get a chance and have more info. Gary Hepting over 9 years ago