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

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -