using jQuery .animate to animate a div from right to left?

后端 未结 5 817
太阳男子
太阳男子 2020-12-04 19:23

I have a div absolutely positioned at top: 0px and right: 0px, and I would like to use jquery\'s .animate() to animate it from it\'s c

5条回答
  •  失恋的感觉
    2020-12-04 19:46

    Here's a minimal answer that shows your example working:

    
    
    hello.world.animate()
    
    
    
    
    
        
    HELLO

    Original Answer:

    You have:

    $("#coolDiv").animate({"left":"0px", "slow");
    

    Corrected:

    $("#coolDiv").animate({"left":"0px"}, "slow");
    

    Documentation: http://api.jquery.com/animate/

提交回复
热议问题