I have a list of several \'triggers\' (
), each trigger shows a specific DIV, and each DIV has \'close\' button.
Now, I want to improve the us
you need a duration in the hide:
$('.copy .wrapper').delay(3000).hide('fast');
You can take a look at the docs http://api.jquery.com/delay/
is this what your looking for?
$('.trigger').bind("mouseenter" , function() {
var id = $(this).attr("data-code"); // Get the data from the hovered element
$('.copy .wrapper:visible').fadeOut();
$('#' + id).stop(true, true).show(); // Toggle the correct div
//Close button
$('.copy .wrapper span').click(function() {
$('.copy .wrapper').fadeOut();
});
});
Thats it get rid of mouseleave listener