当前位置: 首页 > Web前端 > HTML

js实现颜色闪烁效果

时间:2023-04-02 14:16:18 HTML

color

/正文><脚本>setInterval(changeColor,500);//jsvarcolorFlag=0;函数changeColor(){让lit_slashNum=document.querySelector(".lit_slashNum");如果(!colorFlag){lit_slashNum.style.backgroundColor='#0165bb';lit_slashNum.style.boxShadow='0px0px10px2px#0165bb';颜色标志=1;}else{lit_slashNum.style.backgroundColor='';lit_slashNum.style.boxShadow='';颜色标志=0;}}//jq函数litSlash(){$(".lit_slashNum").animate({opacity:"0"},250);改变不透明度$(".lit_slashNum").animate({opacity:"1"},500);}代码笔