0
基本上我想通过每5秒添加一个类.anim
来转换我的元素,但重置它过1秒没有转换属性。CSS:转换一次转换,然后重置它,无需转换
我想要的效果是每5秒钟旋转一次箭头。
这样做的最好方法是什么?
setInterval(function(){
var $el = $("a.inbox");
$el.addClass('anim');
setTimeout(function(){
$el.removeClass('anim');
}, 1000);
console.log($el);
}, 5000);
a.inbox:before {
content: '⇧';
display: inline-block;
position: relative;
-webkit-transform: rotate(180deg);
margin-left: 5px;
transition: -webkit-transform 1s;
}
a.inbox {
&.anim:before {
-webkit-transform: rotate(540deg);
}
}
<a href="#" class="inbox">Inbox</a>
我不关注。 – chovy