Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using more than one Multi Level Menu modules on the same page #1

Open
nirpan opened this issue Jul 10, 2014 · 0 comments
Open

Using more than one Multi Level Menu modules on the same page #1

nirpan opened this issue Jul 10, 2014 · 0 comments

Comments

@nirpan
Copy link

nirpan commented Jul 10, 2014

Hi,

Thank you very much for creating the module. Not sure how much of a work it will be but I tried using two modules loading separate menu items on a same page. I got it working by modifying the default.php so it will use a different ID for each module when loaded and it worked except for a slight 'bug' that meant the user could load both menu at the same time.

I tried a few things like remove the dl-menuopen and dl-active class when the open menu dl-trigger is clicked which didn't really work. In the original article for the plugin there is a comment in this link! which claimed to solve this does not seem to do the job either.

Added this line to the original Plugin just at the beginning.

var pluginName = 'dlmenu';

Initialize and close other menu when press dlmenu

$(function() {
var $menu1 = $( '#dl-menu-1' ).dlmenu();
var $menu2 = $('#dl-menu-2').dlmenu();
$menu1.mousedown(function() {$menu2.data('dlmenu').closeMenu()});
$menu2.mousedown(function() {$menu1.data('dlmenu').closeMenu()});
});

If it could be implemented so that two of the module could be used on the same page, it would be great. Once more, thank you for your work on this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant