Ho questa funzione per spostare un DIV assoluto e voglio eseguire la funzione setTimeout. Tuttavia, JQuery salta fuori dalla funzione hover() quando arriva alla riga $(). Finish(). Come posso eseguire qualcosa dopo il finish()?Come fare qualcosa in JQuery dopo l'animazione Fine()
$('#header li[class!="logo"]').hover(function() {
var leftStart = $(this).position().left;
var width = ($(this).width()/2) - 22;
$('#header .pointerarrow').animate({ left: leftStart + width }, 400);
}, function() {
$('#header .pointerarrow').finish();
//######This does not excecute###########
setTimeout(function() {
alert('succeeded');
var l = $('#header li[class="current"]').position().left;
var b = ($('#header li[class="current"]').width()/2) - 22;
$('#header .pointerarrow').css({ left: l + b });
}, 500);
});
è possibile inviare un violino –
Che cosa significa * "JQuery salta fuori dalla funzione hover()" * significa? Viene generato un errore? Quale errore? –
Vedere il codice di cui sopra, la funzione dopo il commento non eccecute sul mouseout – Jelle