码迷,mamicode.com
首页 > Web开发 > 详细

css3简易制作雷达表,模仿支付宝信誉积分 动态滚动指针:

时间:2020-02-27 17:32:54      阅读:98      评论:0      收藏:0      [点我收藏+]

标签:margin   指针   ntb   模仿   nsf   element   htm   absolute   tom   

html部分:

<div class="mode">
<p class="hu"></p>
<p class="z" id="z"></p>
<p class="center"></p>
</div>

css部分: //可以采用@keyframes结合animation 或者直接js控制c3 动态控制指针
.mode{
height:75px;
width: 120px;
background: #fff;
position: relative;
overflow: hidden;
}
.mode .hu{
position: absolute;
height:100px;
width: 100px;
border:10px solid #eee;
border-radius: 50%;
bottom:-50px;
}
.mode .z{
height:2px;
width: 40px;
background: #ccc;
position: absolute;
border-radius:1px ;
left: 21px;
bottom:0px;
/* animation: move 1s linear infinite alternate; */
transform-origin: 100% 0;
transform: rotateZ(0deg);
transition: transform 1s;
}
.mode .center{
position: absolute;
left: 50%;
bottom:-7px;
height:10px;
width: 10px;
margin-left: -5px;
border-radius:50%;
background:#ccc;
}
/* @keyframes move{
0%{ transform: rotateZ(0deg); }
100%{ transform: rotateZ(180deg); }
} */

js部分:
$(".z").css({‘transform‘:`rotateZ(${70}deg)`}); 或者
document.getElementById(‘z‘).style.transform = `rotateZ(${70}deg)`;

css3简易制作雷达表,模仿支付宝信誉积分 动态滚动指针:

标签:margin   指针   ntb   模仿   nsf   element   htm   absolute   tom   

原文地址:https://www.cnblogs.com/lkkk/p/12373192.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!