The click method has only one argument - the funcion that is going to
be executed on every mouseclick.

Also, you can use the show and hide methods as shortcuts for
manipulating the display property.

The toggles method toggles the display property between the states
"hide" and "show".

$('#top-bar-login li.current').hover(function() {
        $(this).siblings("ul").show();
}, function() {
        $(this).siblings("ul").hide();
});

$('#top-bar-login li.current').click(function() {
        $(this).siblings("ul").toggle();
});

If you wanted to attach 2 or more functions to the click event, you
could use the toggle method (same name as the one above, but different
purpose)...

$('#top-bar-login li.current').toggle(function() {
        $(this).siblings("ul").show();
}, function() {
        $(this).siblings("ul").hide();
});

Now, the first click will execute the first function, second click =
second function, third click = first function again, and so on...

Reply via email to