I have this toggleClass function:
$(document).ready(function() {
$("button#playersize").click(function(){
$("#wrapper").toggleClass("small large");
$(".divone").toggleClass("small large");
$(".divtwo").toggleClass("small large");
});
});
This changes the classes of the divs between "small" and "large" onclick button.
I would like to save the class of the divs (#wrapper, .divone, .divtwo) to a cookie.
And on reload, the class should be the saved one.
How do I manage this?
I have the jquery cookie plugin embedded already.
My code is probably a bit redundant, sorry.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…