javascript - jQuery Close Div Window + cookie -
i have created simple div element notice , close button toggles element
jquery('.float_close').click(function() { jquery('.float_notice').fadetoggle('slow'); 
how hard keep closed possibly using cookies?
not that hard, i'd recommend using additional javascript plugin (http://plugins.jquery.com/cookie/) on top of jquery.
if ($.cookie('noticevisibility') !== undefined && $.cookie('noticevisibility') === 'hidden') { // if cookie stores visibility // of notice set , says 'hidden', hide notice jquery('.float_notice').hide(); } jquery('.float_close').click(function () { jquery('.float_notice').fadetoggle('slow'); // saves cookie later $.cookie('noticevisibility', 'hidden'); });
Comments
Post a Comment