jquery - Keep div hidden on click - Cookies -


i have website webpage, , 2 boxes of texts can toggled off clicking "x" @ top of boxes. close boxes. when reload page, come back. wondering if there way make when user clicks them off first time, stay closed, when reloading. wouldn't need view information second time. here website url.

can cookies, or there other way? have set 1 small box using same code using.

rather use cookies, recommend along these lines localstorage http://caniuse.com/namevalue-storage:

$(".closebtn img").click(function(){     localstorage.announced = true;     $(this).closest(".announce").fadeout(); }); 

then on load:

$(document).ready(function(){     if(typeof(storage)!=="undefined" && localstorage.announced){         $(".announce").hide();     } }); 

Comments

Popular posts from this blog

php - regexp cyrillic filename not matches -

c# - OpenXML hanging while writing elements -

sql - Select Query has unexpected multiple records (MS Access) -