javascript - jQuery animate - get future position of element -
i'm having trouble getting position of element because animation long , $(this).position().top calculated early.
how can future position value of element before animates position?
that's not want. want position of element after animation has completed. need add callback function animation, , call position inside callback function. here go ->
$("whatever").animate({   //do stuff animation }, 'delay', function(){   //our animation has completed, our callback function.   //we can our position.   $(this).position().top }); hope helps!
- also
please consider improving accept rating, 20% either means questions poorly formatted, or aren't following community guidelines. please read faq understand interacting stackoverflow.com
- side note:
you badge 'analytical' reading entire faq. highly suggest it.
Comments
Post a Comment