Currently, I am using jQuery version 10.4.2 and I am trying to smoothly scale up an image that is absolute positioned. However, despite not encountering any errors with the code below, the animation does not happen as expected. Instead, the image suddenly jumps to its full size (100%).
HTML
<div class="box">
<img class="scaleMe" src="img.gif" />
</div>
CSS
.box { position:relative; height:0; padding-bottom:61.6667%; background-image:url('background.gif'); }
.scaleMe { display:block; position:absolute; bottom:0; left:0; z-index:1; width:50%; }
JS
$('.scaleMe').animate({width:'100%'}, 2000);
What could be going wrong in this scenario?
Update:
Check out this functioning jsFiddle example: http://jsfiddle.net/s_d_p/27DhK/
However, when you view this live demo here: , you will notice it doesn't work as intended.