简体   繁体   中英

Start action after second click at element class with jQuery

i have small problem with my jquery function and i need help. So, i have button with close function but this close function must be fire up after some special class added. So at first click at this close button i'm adding class .major_list . Now i need to close some panel after this specify class click... It's working but panel closing after first click when i use .live function, co you help my how to do this after second click and click at class .major_list ?

this is my code:

$('.bottom_panel_button_01').click(function(){
    $(this).addClass('major_list');
});

$('.major_list').delay(300).live('click', function(){
    setTimeout(function(){
    },600).stop(true,true);
});

much thx for help!

$('.bottom_panel_button_01').click(function(){        
    if ($(this).hasClass("major_list")) {
        /* close */
    } else {
        $(this).addClass('major_list');
    }
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM