Ho trovato un ottimo tutorial su come mostrare e nascondere un certo div su una pagina. Ho ottenuto il codice funzionante, ma mi piacerebbe estendere è che lo show/hide è ricordato sui carichi di pagina. Ho cercato una soluzione jQuery cookie è stato la risposta .. se avessi saputo come scrivere il codice che è .. Ecco il frammento di corrente:Utilizzare jQuery cookie.js per ricordare l'elemento hide/show?
<script type="text/javascript">
jQuery(document).ready(function() {
// hides the group_desciption as soon as the DOM is ready
// (a little sooner than page load)
jQuery('#group_desciption').hide();
// shows the group_desciption on clicking the noted link
jQuery('a#slick-show').click(function() {
jQuery('#group_desciption').show('slow');
return false;
});
// hides the group_desciption on clicking the noted link
jQuery('a#slick-hide').click(function() {
jQuery('#group_desciption').hide('fast');
return false;
});
// toggles the group_desciption on clicking the noted link
jQuery('a#slick-toggle').click(function() {
jQuery('#group_desciption').toggle(400);
return false;
});
});</script>
Qualsiasi idea di come posso aggiungere i biscotti per ricorda la selezione dall'utente? Un esempio di codice sarebbe grande visto che sto ancora cercando di capire jQuery/Javascript in generale :)
Grazie in anticipo :)
Grazie !! con un po 'di aiuto e scherzi, ho fatto in modo che funzionasse perfettamente! –