I would really appreciate some help implementing a cookie to save the state of a toggle in JQuery, I have created the toggle using he code in the fiddle below and have tried implementing the answer from BARMAR in the thread below but this changes the state of the tags just below it and closes the tags every time the page is loaded when I try to implement it.
Thread I have looked at: Preserve toggle state using jQuery
My Fiddle thus far:
<script type="text/javascript">
$(function() {
$('#slide1').click(function() {
$('.slide1').slideToggle('slow');
$('.toggle1').toggle();
return false;
});
});
</script>
<a href="#" id="slide1">Slide Toggle
<span class="toggle1">+</span>
<span class="toggle1" style="display:none;">-</span>
</a>
<div class="slide1" style="display:none; background-color:#4CF;width:100px;height:200px;"></div>
Any help would be appreciated,
Thanks!