Question

When the element h4 is clicked, I would like to .toggle() the .mChatBodyFix but I would like to toggle the $.cookie to either be yes or no

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

Solution

How about

$.cookie('chat', $.cookie('chat')=='yes'?"no":"yes", {expires:1});

OTHER TIPS

Try this!

$('.cat h4').not('.mChatOpts span').click(function(){
    $('.mChatBodyFix').toggle();
    var myCookie = $.cookie('chat')=='yes'?"no":"yes";
    $.cookie('chat', myCookie, {expires:1});
});
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top