I have a toggle switch that shows and hides an email address that I want to be consistent on each page of my website.
Here's the code I'm using now for the toggle effect, which is working great. (Don't worry, I'm using email obfuscation techniques on my actual site, I've just simplified the code below for the sake of tidiness).
HTML
<a id="contact-switch" href="javascript:void(0);">Contact</a>
<div id="contact-content">xxx@gmail.com</div>
jQuery
<script type="text/javascript">
$("#contact-switch").click(function() {
$("#contact-content").fadeToggle("fast", "linear");
});
</script>
What would be the best way to keep the state of this toggle consistent on each page of my site assuming I have these same elements on each page of my site?
In other words if I have the email address showing on one page, the toggle will be activated on the next page I go to, and if I turn it off on the next page then it will stay turned off on the next page after that, etc?
I've heard something about storing info in window.load
but I'm not sure what that means. Any help would be greatly appreciated. Thank you!!