I want to achieve an effect where a close button appears after some time of hovering the mouse on a div. How could I do that? by the way, I’m so new to jQuery.
Here is an example of something similar to what I want

That “x” in the corner I want to appear in one of my designs.
Thanks to everyone
What I have done so far:
jQuery:
$("#slider #content").on("hover", '.element', function(evt) {
var top, left;
top = $(this).offset().top;
left = $(this).offset().left;
$(".close-button").css({"top":top, "left":left});
$(".close-button").show();
});
The div and the styling of the div I guess is irrelevant if not, I would post it here.
Here’s one way of doing this, given the following HTML:
And the CSS:
And the jQuery:
JS Fiddle demo.
References:
click().closest().eq().fadeIn().fadeOut().fadeToggle().find().index().