猿问

js 扫描效果插件

求一个js插件。

如下图所示,一个扫描,从所有tab上扫描过;如果tab报警,则扫描条变为报警的扫描效果。

梵蒂冈之花
浏览 1316回答 1
1回答

开心每一天1111

<!DOCTYPE html><html><head>&nbsp; &nbsp; <meta charset="UTF-8">&nbsp; &nbsp; <title>Document</title>&nbsp; &nbsp; <script type="text/javascript" src="jquery-1.11.1.min.js"></script>&nbsp; &nbsp; <style>&nbsp; &nbsp; &nbsp; &nbsp; body{position: relative;}&nbsp; &nbsp; &nbsp; &nbsp; div#content{height:500px;border:2px solid #f00;}&nbsp; &nbsp; &nbsp; &nbsp; div#scan{height:500px;width:300px;position: absolute;;left:-100px;top:0px;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: -webkit-linear-gradient(left,rgba(200,0,0,0),rgba(200,0,0,0.3)); /* Safari 5.1 - 6.0 */&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: -o-linear-gradient(right,rgba(200,0,0,0),rgba(200,0,0,0.3)); /* Opera 11.1 - 12.0 */&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: -moz-linear-gradient(right,rgba(200,0,0,0),rgba(200,0,0,0.3)); /* Firefox 3.6 - 15 */&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: linear-gradient(to right,rgba(200,0,0,0),rgba(200,0,0,0.3)); /* 标准的语法 */&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; &nbsp; &nbsp; div#scan.yellow{&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: -webkit-linear-gradient(left,rgba(200,200,0,0),rgba(200,200,0,0.3)); /* Safari 5.1 - 6.0 */&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: -o-linear-gradient(right,rgba(200,200,0,0),rgba(200,200,0,0.3)); /* Opera 11.1 - 12.0 */&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: -moz-linear-gradient(right,rgba(200,200,0,0),rgba(200,200,0,0.3)); /* Firefox 3.6 - 15 */&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; background: linear-gradient(to right,rgba(200,200,0,0),rgba(200,200,0,0.3)); /* 标准的语法 */&nbsp; &nbsp; &nbsp; &nbsp; }&nbsp; &nbsp; </style></head><body>&nbsp; &nbsp; <div id="content" style="">&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; </div>&nbsp; &nbsp; <div id="scan" style=""></div>&nbsp; &nbsp; <script type="text/javascript">&nbsp; &nbsp; $(function(){&nbsp; &nbsp; &nbsp; &nbsp; $("#scan").animate({left:"+=1000px"},1000*20,"linear",function(){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(this).css({left:"-100px"});&nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp; setInterval(function(){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $("#scan").animate({left:"+=1000px"},1000*20,function(){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $(this).css({left:"-300px"});&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; });&nbsp; &nbsp; &nbsp; &nbsp; },1000*20);&nbsp; &nbsp; &nbsp; &nbsp; setTimeout(function(){&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $("#scan").addClass("yellow");&nbsp; &nbsp; &nbsp; &nbsp; },3000)&nbsp; &nbsp; })&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp; &nbsp; </script></body></html>@挺问中原 提供的答案我赞同,我就不写什么其他的想法了
随时随地看视频慕课网APP

相关分类

JavaScript
我要回答