欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

js實(shí)現(xiàn)彩色條紋滾動(dòng)條效果

 更新時(shí)間:2017年03月15日 10:59:08   作者:shangpudxd  
本文主要介紹了js實(shí)現(xiàn)彩色條紋滾動(dòng)條效果的實(shí)例。具有很好的參考價(jià)值。下面跟著小編一起來(lái)看下吧

左側(cè)可用調(diào)色板選擇條紋顏色

效果圖:

代碼如下:

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<style>
*{margin:0; padding:0;}
@-webkit-keyframes demo{
 from{ left:0;}
 to{ left:-113px;}
}
.box{ width:120px; height:400px; border:1px solid #000; margin:100px auto; position:relative; overflow:hidden;}
.bar{ position:absolute; left:0; top:0; width:500px; height:400px; background: -webkit-repeating-linear-gradient(-45deg , red 0px, red 20px, #fff 20px, #fff 40px, blue 40px, blue 60px, #fff 60px, #fff 80px); animation:demo 2s linear infinite; }
</style>
<script>
window.onload = function(){
 var oC1 = document.querySelectorAll('input')[0];
 var oC2 = document.querySelectorAll('input')[1];
 var oBar = document.querySelector('.box .bar');
 oC1.onchange = oC2.onchange = function(){
 oBar.style.background = '-webkit-repeating-linear-gradient(-45deg , '+oC1.value+' 0px, '+oC1.value+' 20px, #fff 20px, #fff 40px, '+oC2.value+' 40px, '+oC2.value+' 60px, #fff 60px, #fff 80px)';
 };
};
</script>
</head>
<body>
 <input type="color" value="#ff0000" />
 <input type="color" value="#0000ff" /> 
 <div class="box">
 <div class="bar"></div>
 </div>
</body>
</html>

以上就是本文的全部?jī)?nèi)容,希望本文的內(nèi)容對(duì)大家的學(xué)習(xí)或者工作能帶來(lái)一定的幫助,同時(shí)也希望多多支持腳本之家!

相關(guān)文章

最新評(píng)論