javascript - Jquery animate - callback executing before animation is complete -


what i'd accomplish element expand in height, , apply background image once height change complete. i've noticed background image in callback applies before height animation complete resulting in laggy performance. can tell me why is?

$(document).ready(function() {     $('#hero').animate({         height: ($(window).height() - $("#hero").offset().top - 50)      }, 100, function() {         $('#hero').css('background-image', 'url(./img/hero.jpg)');     }); }); 

you have transition: 1s ease on #hero, cause animation play erratically since trying use css3 animations animate jquery animation (and throw kinds of timing problems).

what suspect happening getting notified jquery animation completed, css3 animation doesn't complete additional 1s, why seeing are.


Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -