I've got this piece of script here, where I'd like to slide up my ul element, then after the slide up executed, I'd like to remove the "open" class for CSS reasons. What am I doing wrong?
jQuery(this).parent().children("ul").slideUp(500);
setTimeout(function(){
var elementToRemove = jQuery(this).parent();
elementToRemove.removeClass("open");
}, 500);