Hello!
The script below takes an image of id assinatura
and applies an effect to it when my scroll is at a certain height of the site.
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 400) {
$("#assinatura").addClass("animated jello");
}
});
However, I would like that when the scroll reaches 400 or more in height, the program waited 2 seconds to apply the effect I wanted. (2 seconds for testing).
So I tried to do it in the form below, but that resulted in the same thing as the previous one, ie the program is only running as if it did not hear setTimeOut:
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 400) {
window.setTimeout($("#assinatura").addClass("animated jello"), 5000);
}
});