Is there a more efficient way to hide elements?


Madison Square Market - JQuery Project

It works

var main = function () {
    $(".account .dropdown-menu").hide();
    $(".help .dropdown-menu").hide();
    $(".cart .dropdown-menu").toggle();
    $('.cart .dropdown-menu').hide();
    $('.help .dropdown-menu').hide();
    $(".account .dropdown-menu").toggle();
    $('.cart .dropdown-menu').hide();
    $(".account .dropdown-menu").hide();
    $(".help .dropdown-menu").toggle();



Here's what I came up with..edited in the hiding part which I missed initially.

    //hide all menus first.
    // now toggle just this one!


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.