So I would like to change the class name of a jQuery object.
This is what I have:
var container = $('#container');
Then in the following function I would like to change the classname to newstate
function setstate(newstate) {
state = newstate;
//change container.classname to setstate
currentsate = state;
}
I have looked up how to do this and tried the toggleClass and removeClass then addClass methods but neither seem to be working.
Also, in this function I need to get the position right, will these lines work?
function init() {
var temp = container.offset();
xoffset = temp.left;
yoffset = temp.top;
fontsize = container.offsetHeight / 1.5;
linewidth = container.offsetHeight / 19;
setstate('intro');
}
Thank you.