Pergunta

Dizer, por exemplo, eu tenho uma animação em execução em foco, naturalmente, é fácil parar na nossa função de retorno de chamada - eu preciso parar a animação depois de 1 segundo, eu iria fazer isso com ClearInterval?Minha função Real pode ser visto aqui http://jsfiddle.net/7hujh/

$(elem).hover(function() {

  // animate

}, function () {

  // stop animating

});
Foi útil?

Solução

Sim, basta limpar o intervalo depois de um segundo:

setTimeout(function() {clearInterval(vibrateIndex);}, 1000);

VIOLINO

Outras dicas

$(elem).hover(function() {

   $("#item").animate({property:value},interval).delay(1000).stop(0,0);

}, function () {

  // stop animating

});
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top