How can I delay a CSS change in jquery? Here is my code:
$(\"document\").ready(function() {
$(\".pressimage img\").mouseenter(function() {
$jq(this)
http://jsfiddle.net/loktar/yK5ga/
Check that one out what I am doing is assigning the timeout to a variable and then clearing it on mouseover, so it wont fire if you do a mouse over quickly.
$("document").ready(function() {
var imgTimeout;
$("img").hover(
function() {
clearTimeout(imgTimeout);
$(this).css('z-index','1000');
},
function() {
var element = $(this);
imgTimeout = setTimeout(function(){element.css('z-index','1');}, 1000);
});
});