Reputation: 1193
How to make this just fade out on mouseover and just fade back in again on mouseleave? My jsFiddle
$(function() {
var box = $('#box');
box.on('mouseover', function() {
box.fadeOut(500);
});
box.on('mouseleave', function() {
box.fadeIn(500);
});
});
Upvotes: 0
Views: 998
Reputation: 318182
$(function() {
$('#box').on('mouseenter mouseleave', function() {
$(this).stop().fadeToggle();
});
});
Upvotes: 2
Reputation: 12375
try this:
$(function() {
var box = $('#box');
box.hover(function() {
$(this).fadeOut(500);
}, function() {
$(this).stop().fadeIn(500);
});
});
see this fiddle
Upvotes: 1