3

I am actualy trying to implement the jquery aim menu plugin on my page

What I cant handle is that drupal sets the first and secound level of the menu at the exact same classes and i have no idea what i should tell jquery to use as his selector.

I started with something like that about 3 hours ago

$("#main-menu").menuAim({
    activate: function(a){
        $(this).children('ul').css('display','block');
    },  // fired on row activation
    deactivate: function(a){
        $(this).children('ul').css('display','none');

    }  // fired on row deactivation
});

Any idea how to fix that?

4

1 回答 1

0

尝试这个:

$( "#main-menu" ).addClass( "new_class" );

$(".new_class").menuAim({
    activate: function(a){
        $(this).children('ul').css('display','block');
    },  // fired on row activation
    deactivate: function(a){
        $(this).children('ul').css('display','none');

    }  // fired on row deactivation
});

这应该确保没有冲突。

于 2015-07-30T15:32:07.247 回答