CSS3 translate out of screen

后端 未结 8 1708
南旧
南旧 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条回答
  •  Happy的楠姐
    2021-02-07 08:10

    get the document width. then use a java script trigger to trigger the css3 translation.

           function translate(){
    
           var width = document.body.Width;
            document.getElementById('whateverdiv').style='translateX(' + width + 'px)';
    
           }
    

提交回复
热议问题