The example in this article describes how to use js to achieve the effect of gradient switching of images from left to right. Share it with everyone for your reference. The specific implementation method is as follows:
<script><br> var n=0;<br> var showNum = document.getElementByIdx_x("num");<br> function Mea(value){<br> n=value;<br> setBg(value);<br> plays(value);<br> }<br> function setBg(value){<br> for(var i=0;i<4;i )<br /> if(value==i){<br /> showNum.getElementsByTagName_r("td")[i].className='woon';<br /> }<br /> else{<br /> showNum.getElementsByTagName_r("td")[i].className='wooff';<br /> } <br /> }<br /> function plays(value){<br /> with (fc){<br /> filters[0].Apply();<br /> for(i=0;i<4;i )i==value?children[i].style.display="block":children[i].style.display="none";<br /> filters[0].play(); <br /> }<br /> }<br /> function clearAuto(){clearInterval(autoStart)}<br /> function setAuto(){autoStart=setInterval("auto(n)", 5000)}<br /> function auto(){<br /> n ;<br /> if(n>3)n=0;<br> Mea(n);<br> }<br> function sub(){<br> n--;<br> if(n<0)n=3;<br> Mea(n);<br> }<br> setAuto();<br> </script> |