js实现图⽚从左往右渐变切换效果的⽅法
本⽂实例讲述了js实现图⽚从左往右渐变切换效果的⽅法。分享给⼤家供⼤家参考。具体实现⽅法如下:
复制代码代码如下:
<style type="text/css">
.woon{border:1px solid #fff;}
.wooff{border:1px solid #ffffff;filter:progid:DXImagetransform.Microsoft.Alpha(style=1,opacity=1500,finishOpacity=1);}
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
<table width=500 border=0 align=center cellPadding=0 cellSpacing=0
background="s16.sinaimg/middle/60d27f6dt7942731cd87f&690">
<tr>
<td height="300" align="center">
<div id=fc >
<div ><A
href="#" target=_blank><img onmouseover=clearAuto(); onmouseout=setAuto() height=300
src="s15.sinaimg/middle/60d27f6dtbc987f277bde&690" width=500 border=0></A></div>
<div ><a href="#" target="_blank"><img onmouseover=clearAuto(); onmouseout=setAuto() height=300 src="s10.sinaimg/middle/60d27f6dtbc987f42b6b9&690" width=500 border=0></a></div>
<div ><A href="#" target=_blank><img onmouseover=clearAuto(); onmouseout=setAuto()
height=300 src="s4.sinaimg/middle/60d27f6dtbc987f3c3303&690" width=500 border=0></A></div>
<div ><a href="#" target=_blank><img onmouseover=clearAuto(); onmouseout=setAuto()
height=300 src="s12.sinaimg/middle/60d27f6dt7942732166fb&690" width=500 border=0></a></div>
</div></td>
</tr>
<tr>
<td height=100 valign="top"> <table border=0 align=center cellPadding=0 cellSpacing=1 id=num>
<tr>
<td class=woon onmouseover=clearAuto();onclick=Mea(0); onmouseout=setAuto() >
<img src="s15.sinaimg/middle/60d27f6dtbc987f277bde&690" width="120" height="70" onDblClick="MM_openBrWindow('#','','')"></td>
<td class=wooff onmouseover=clearAuto(); onclick=Mea(1); onmouseout=setAuto() >
<img src="s10.sinaimg/middle/60d27f6dtbc987f42b6b9&690" width="120" height="70" border="0" onDblClick="MM_openBrWindow('#','','')"></td>
<td class=wooff onmouseover=clearAuto(); onclick=Mea(2); onmouseout=setAuto() >
<img src="s4.sinaimg/middle/60d27f6dtbc987f3c3303&690" width="120" height="70" onDblClick="MM_openBrWindow('#','','')"></td>
<td class=wooff onmouseover=clearAuto(); onclick=Mea(3); onmouseout=setAuto() >
<img src="s12.sinaimg/middle/60d27f6dt7942732166fb&690" width="120" height="70" onDblClick="MM_openBrWindow('#','','')"></td>
</table>
<script>
var n=0;
var showNum = ElementByIdx_x("num");
function Mea(value){
n=value;
setBg(value);
plays(value);
}
function setBg(value){
for(var i=0;i<4;i++)
if(value==i){
}
else{
}
}
function plays(value){
with (fc){
filters[0].Apply();
for(i=0;i<4;i++)i==value?children[i].style.display="block":children[i].style.display="none";  filters[0].play();
}
}
function clearAuto(){clearInterval(autoStart)}
function setAuto(){autoStart=setInterval("auto(n)", 5000)}
function auto(){
n++;
if(n>3)n=0;
Mea(n);
}
function sub(){
n--;
if(n<0)n=3;
Mea(n);
}
setAuto();
</script>
</body>代码运行js特效
</html>
希望本⽂所述对⼤家的javascript程序设计有所帮助。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。