jQuery animate from CSS “top” to “bottom”

后端 未结 9 1728
北海茫月
北海茫月 2021-01-04 06:49

I\'m looking to animate a div element from an absolute top position to an absolute bottom position on the page load.

The combination of CSS and jQuery code below fai

9条回答
  •  被撕碎了的回忆
    2021-01-04 07:39

    Possibly:

     $("#line-three").animate({position:'absolute',top:'auto',bottom:'100px'},1200)
    

    EDIT

    Yes, this is going to be trickier than it first appears. You'll might need to analyse it's current position relative to it's container (using offset) and work from there.

提交回复
热议问题