jquery cookie for show hide script -
i working on small interface use very simple show , hide script.
    $(document).ready(function(){       $("#hide").click(function(){         $(".advanced").hide();         $(".basic").show();       });       $("#show").click(function(){         $(".advanced").show();         $(".basic").hide();       });     });   the purpose of hide , show element within navigation (basic , advanced view speak). question how can combine cookie plugin? preference stays saved , not jump "basic" view if change different page.
thank much, daniel
may have @ localstorage (in german, can't find in english)
here in english localstorage en
(because not people allow cockies)
you can store data
localstorage.setitem("key", "value");  localstorage.getitem("key");   working fiddle (a way how it)
$(document).ready(function () {      $(".advanced").css('display', localstorage.getitem('advanced'));     $(".basic").css('display', localstorage.getitem('basic'));      $("#hide").click(function () {         $(".advanced").hide();         $(".basic").show();         localstorage.setitem('advanced', 'none');         localstorage.setitem('basic', 'block');     });      $("#show").click(function () {         $(".advanced").show();         $(".basic").hide();         localstorage.setitem('advanced', 'block');         localstorage.setitem('basic', 'none');     }); });      
Comments
Post a Comment