Deadweight
10-14-2013, 03:51 PM
Hello, Im using jquery to add and remove classes. However, i want it to delay the removal or addition of the class. Here is my query:
$('div.dropper').click(function(){
if($(this).children('.sub_title').hasClass('closed')){
$(this).children('.sub_title').removeClass('closed').addClass('opened');
$(this).children('.content').slideDown(300);
}else{
$(this).children('.content').slideUp(300);
$(this).children('.sub_title').delay(300).addClass('closed').removeClass('opened');
}
});
What I'm trying to do is when the content finishes scrolling up then i want the class to change.
Any ideas? Thanks
$('div.dropper').click(function(){
if($(this).children('.sub_title').hasClass('closed')){
$(this).children('.sub_title').removeClass('closed').addClass('opened');
$(this).children('.content').slideDown(300);
}else{
$(this).children('.content').slideUp(300);
$(this).children('.sub_title').delay(300).addClass('closed').removeClass('opened');
}
});
What I'm trying to do is when the content finishes scrolling up then i want the class to change.
Any ideas? Thanks