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

modal

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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -