I would like to save the state of site-header display. How i can save it with Jquery Cookie?
(function ($) {
// The initial load event will try and pull the cookie to see if the toggle is "open"
var openToggle = getCookie("show") || false;
if ( openToggle )
div.style.display = "block";
else
div.style.display = "none";
if ( window.location.pathname == '/' ){
// Index (home) page
div.style.display = "block";
}
// The click handler will decide whether the toggle should "show"/"hide" and set the cookie.
$('#Togglesite-header').click(function() {
var closed = $("site-header").is(":hidden");
if ( closed )
div.style.display = "block";
else
div.style.display = "none";
setCookie("show", !closed, 365 );
});
});