I have a simple code that keeps an element visible while a mouse hovers over it and hides it once the mouse is out.:
$(".item").hover(
function () {
$(this).show();
},
function () {
$(this).hide();
}
);
I would like to add some delay before it hides, but adding $(this).delay(500).hide();does not seem to work…
Here is a demo: http://jsfiddle.net/e3cNK/1/
If you want to be able to re-show the element after it has been hidden then you want to change the opacity of the element rather than changing its
displaytonone. This will keep the elements in the regular flow of the page so when the user mouse-overs the hidden element it can show again:Here is a demo: http://jsfiddle.net/e3cNK/2/