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

https://stackoverflow.com/faq

  • side note:

you badge 'analytical' reading entire faq. highly suggest it.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -