Remember Toggle state with JQuery after refresh?

I got a small script wich toggles my nav. But im using the nav in more pages. I want jquery to remember the toggle(show/hide) state so i can use it when navigating.

$('ul.first li.first a').click(function(){

ps: I know my english is not very good :))



You could use either use cookie management or localStorage to store this info across your session. LocalStorage only works with html5 though.

Here's a good article on a plugin that features both, so you don't need to detect yourself if the browser is capable of localStorage or not:


You can also add a hash to the url and detect the hash after page refresh.

More details on hash here


you can do it with slide function of jquery just design the panel and flip element to your liking with css like this

.flip {

#panel {

<script src="">



<div class="flip">Click to slide the panel down or up</div>
<div id="panel">Hello world!</div>



Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.