太极图 鼠标划入转动

<style type="text/css">

太极

太极

* {

padding:0;

margin:0;

}

body {

background:#eee;

}

.tjt {

width:200px;

height:200px;

border-radius:50%;

background:linear-gradient(90deg,black 50%,white 50%);

margin:50px auto;

position:relative;

}

.tjt:before {

content:" ";

position:absolute;

width:0px;

height:0px;

padding:25px;

border:25px solid black;

border-radius:50%;

background:white;

left:50px;

}

.tjt:after {

content:" ";

width:0px;

height:0px;

padding:25px;

border:25px solid white;

border-radius:50%;

background:black;

position:absolute;

left:50px;

top:100px;

}

var x =0;

var zh;

function xz() {

clearInterval(zh)

zh =setInterval(function () {

x =x +1;

document.getElementById("tj").style.transform ='rotate(' +x +'deg)';

},20)

}

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。