You need to use closure variables
jQuery(document).ready(function () {
// Rollover on features
jQuery(".TitleImageBlurbandLinkWrapper a").hover(function () {
var thisfeature = jQuery(this);
// change class when slide starts
thisfeature.addClass("hover");
// Show info sliding up
thisfeature.find(".blurb").stop(true, true).slideDown();
}, function () {
var thisfeature = jQuery(this);
// hide info
thisfeature.find(".blurb").stop(true, true).slideUp({
queue: false,
complete: function () {
// change class when slide finishes
thisfeature.removeClass("hover");
}
});
});
});
When you enter element 1 thisfeature
refers to that element, then you move out so the mouseleave animation is triggered for the correct element, but before the animation is over you enter element 2 now the global variable thisfeature
is referring to element 2 not element 1 by this time the mouseleave animation for element 1 is over and the complete callback is called but now thisfeature
is element 2 instead of element 1