I've written a jQuery plugin which makes an element pulse. It's working great in Chrome and Internet Explorer 9. In Internet Explorer 8, it's not working after the setTimeout call.
I've created a jsFiddle to demonstrate the problem: http://jsfiddle.net/Guykp/ Here's the javascript code:
$(document).ready(function() {
$.fn.pulseEffect = function(delay, duration) {
var $element, animateOptions;
$element = $(this);
if (!$element.is(":hover")) {
animateOptions = {
opacity: $element.css("opacity") === "1" ? .6 : 1
};
$element.animate(animateOptions, duration);
}
return setTimeout((function() {
return $element.pulseEffect(delay, duration);
}), delay + duration);
};
$("#pulse-element").pulseEffect(0, 1000);
});
How can I make it working in Internet Explorer 8?
This is the error message from Internet Explorer 8: Syntax error, unrecognized expression: unsupported pseudo: hover
This is the solution: How do I check if the mouse is over an element in jQuery?