How do I use easing or time delay on addClass();?
$("#date_1").hover(
function () {
$(this).addClass("door");
$(this).addClass("doorstatic", "slow"); // after 2seconds i want to add this class during the hover
},
function () {
$(this).removeClass("door");
$(this).removeClass("doorstatic"); // both classes are instantly removed when hover off
}
);
You can group your classes like
removeClass("door doorstatic")The problem here is that if you mouseover and before two seconds mouse out you will still have the class
doorstaticon you element.The fix:
Created a live example of the solution at jsFiddle.