I'm trying to make a toggle that toggles between two classes when clicked on the object with function "openclose(j)". I tried making the script only removeClass("arrow-down"), which works fine, but it wont addClass("arrow-up"). This is really annoying to deal with :)
function openclose(j){
if(jQuery('#div_'+j).hasClass("arrow-down")) {
jQuery('#div_'+j).removeClass("arrow-down").addClass("arrow-up");
}
if (jQuery('#div_'+j).hasClass("arrow-up")) {
jQuery('#div_'+j).removeClass("arrow-up").addClass("arrow-down");
}
jQuery('#collaps_'+j).toggle(
function () {
}
);
}
Any help is much appreciated,
Regards, Mathias