CSS3 translate out of screen

后端 未结 8 1914
南旧
南旧 2021-02-07 07:48

For a number of projects now I have had elements on the page which I want to translate out of the screen area (have them fly out of the document). In proper code this should be

8条回答
  •  自闭症患者
    2021-02-07 08:19

    This is simple add the following to your div

    .myDiv {
        -webkit-transition-property: left;
        -webkit-transition-duration: 0.5s;
        -webkit-transition-timing-function: ease-in-out;
        -webkit-transition-delay: initial
    }
    

    then change the "left" property of it either by adding an additional class or by jQuery

    This will animate it along the x-axis

    Note: you can change the -webkit-transition-property to any property you want and this will animate it

提交回复
热议问题