jQuery animate from CSS “top” to “bottom”

后端 未结 9 1723
北海茫月
北海茫月 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:47

    You can animate it using this: Check out this JSFiddle:

    $('#button').click(function(e){ // On click of something
        e.preventDefault(); // Prevent the default click aciton
        $("#line-three").animate({
            top: "300px",
        }, 1200);
    });
    

提交回复
热议问题