首页 > 代码库 > js元素闪动效果
js元素闪动效果
<img src="http://yjy.allbring.com/UpLoadFiles/head/p1_20140326104945_17-10164142709.jpg" style=" position:relative;" id="aa" />
function setAnimation() { var attr = ["top", "left"], b = 0; u = setInterval(function () { document.getElementById("aa").style[attr[b % 2]] = (b++) % 4 < 2 ? 0 : 4; //alert(document.getElementById("aa").tagName); b++; if (b > 30) { clearInterval(u); b = 0; setAnimation(); } }, 32); }
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。