jQuery cookie and toggle()

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});
    });

Answers


How about

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

Need Your Help

how to parse the gaps?

python xpath python-3.x lxml

please help get prices from the pages of ebay.

How to Format Numbers in WinForms 1.1 DataGrid?

winforms

Is there a simple way to format numbers in a Winforms 1.1 datagrid? The Format property of the DataGridTextBoxColumn seems to be completely ignored. I know there is a solution that involves subcl...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.