純CSS3實現球體轉動效果

效果圖如圖所示orm

一、首先咱們要寫四個方形div,將方形圓角化變成四個圓,而後初始化四個div的偏轉角度,如transform: rotateY(45deg);blog

 

二、設置轉動週期角度和週期時間animation: animation2 4s;ci

 

 

三、寫一個clcik方法控制四個圓形的轉動或中止animation-play-state:paused。這樣就大功告成了animation

 

相關文章
相關標籤/搜索