falsh(graphic){
let temp = 0;
let handler = setInterval(function() {
if (temp === 6) {
if (handler) {
if (!graphic.visible)
//graphic.show();
graphic.visible=true;
clearInterval(handler);
handler = null;
}
return;
}
if (graphic.visible)
graphic.visible=false;
else
graphic.visible=true;
temp++;
}, 400);
},
备注:400为400毫秒,6表示闪烁3次
本文介绍了一种使用JavaScript在网页上实现元素闪烁效果的方法。通过设置定时器,使指定的图形元素在可见与不可见状态间切换,达到闪烁的效果。闪烁次数和间隔时间均可自定义。

2863

被折叠的 条评论
为什么被折叠?



