0

当元素h4被点击时,我想,.toggle().mChatBodyFix我想切换$.cookieyes或者no

    $('.cat h4').not('.mChatOpts span').click(function(){
        $('.mChatBodyFix').toggle();
        $.cookie('chat', 'yes', {expires:1});
    });
4

2 回答 2

3

How about

$.cookie('chat', $.cookie('chat')=='yes'?"no":"yes", {expires:1});
于 2013-08-08T15:41:45.430 回答
0

尝试这个!

$('.cat h4').not('.mChatOpts span').click(function(){
    $('.mChatBodyFix').toggle();
    var myCookie = $.cookie('chat')=='yes'?"no":"yes";
    $.cookie('chat', myCookie, {expires:1});
});
于 2013-08-08T15:44:58.123 回答