当元素h4
被点击时,我想,.toggle()
但.mChatBodyFix
我想切换$.cookie
为yes
或者no
$('.cat h4').not('.mChatOpts span').click(function(){
$('.mChatBodyFix').toggle();
$.cookie('chat', 'yes', {expires:1});
});
当元素h4
被点击时,我想,.toggle()
但.mChatBodyFix
我想切换$.cookie
为yes
或者no
$('.cat h4').not('.mChatOpts span').click(function(){
$('.mChatBodyFix').toggle();
$.cookie('chat', 'yes', {expires:1});
});
How about
$.cookie('chat', $.cookie('chat')=='yes'?"no":"yes", {expires:1});
尝试这个!
$('.cat h4').not('.mChatOpts span').click(function(){
$('.mChatBodyFix').toggle();
var myCookie = $.cookie('chat')=='yes'?"no":"yes";
$.cookie('chat', myCookie, {expires:1});
});