Stack jQuery events on elements to avoid delays.
Don't do this:
$('.feature').mouseenter( function() {
$(this).animate({
height: 540
}, 'fast', function() {});
});
$('.feature').mouseleave( function() {
$(this).animate({
height: 300
}, 'fast', function() {});
});
Do this:
$('.feature').mouseenter( function() {
$(this).animate({
height: 540
}, 'fast', function() {});
}).mouseleave( function() {
$(this).animate({
height: 300
}, 'fast', function() {});
});
To avoid jQuery delaying each time to interact with an element.
Written by Whitney Krape
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Jquery
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#