Reputation: 2917
I am animating one image(i.e)scaling a image like
$('#img').animate({height:'300px','width':'20px'},2000);
i need to get the current height of the image during the animation. i tried step property. But its printing so many points which is unrelated to animation.
Any Idea
Upvotes: 1
Views: 2546
Reputation: 2005
var pos = $('#img').position();
alert(pos.top + ', ' + pos.left);
See this link.
Upvotes: 0
Reputation: 2005
There's a step option in the animate function that allows for callbacks during the animation. In that callback you can request the position and do what you want with it.
Upvotes: 2