找页面的循环效果的源代码
循环图片效果,谁有相似的代码,JavaScript可以,其他asp.net的也可以
循环图片效果,谁有相似的代码,JavaScript可以,其他asp.net的也可以
答案:<td colspan = "3">
<div id = "guangGao">
<div style="float: left; display: inline; margin-left: 6px;" id="div0">
<a href=> <img src="images/games.jpg" onmouseover="stop();" onmouseout="start();" width = "400px" height = "300px" border = "0px"/></a></div>
<div style="float: left; display: none; margin-left: 6px;" id="div1">
<a href=> <img src="images/2010_index.jpg" onmouseover="stop();" onmouseout="start();" width = "400px" height = "300px" border = "0px"/></a></div>
<div style="float: left; display: none; margin-left: 6px;" id="div2">
<a href=> <img src="images/ten.jpg" onmouseover="stop();" onmouseout="start();" width = "400px" height = "300px" border = "0px"/></a></div>
<div style="float: left; display: none; margin-left: 6px;" id="div3">
<a href=> <img src="images/yizhu_index.jpg" onmouseover="stop();" onmouseout="start();" width = "400px" height = "300px" border = "0px"/></a></div>
<div style="float: left; display: none; margin-left: 6px;" id="div4">
<a href=> <img src="images/bc.jpg" onmouseover="stop();" onmouseout="start();" width = "400px" height = "300px" border = "0px"/></a></div>
<div>
<ul style = "list-style:none;position:absolute;top:85%;left:43%">
<li><span class="slive" id="but0" onmouseover="stop();i = 0;change();" onmouseout="start();">1</span></li>
<li><span class="before" id="but1" onmouseover="stop();i = 1;change();" onmouseout="start();">2</span></li>
<li><span class="before" id="but2" onmouseover="stop();i = 2;change();" onmouseout="start();">3</span></li>
<li><span class="before" id="but3" onmouseover="stop();i = 3;change();" onmouseout="start();">4</span></li>
<li><span class="before" id="but4" onmouseover="stop();i = 4;change();" onmouseout="start();">5</span></li>
</ul>
</div>
</div>
<script type="text/javascript">
i = 0;
function start()
{
cc = setInterval('change()',3000);
}
function stop()
{
clearInterval(cc);
}
function change()
{
reflash();
i++;
if(i >= 5)
{
i = 0;
}
}
function reflash()
{
for(var x = 0; x < 5; x++)
{
ooo = document.getElementById("but" + x);
odiv = document.getElementById("div" + x);
if(x == i)
{
ooo.className = "slive";
odiv.style.display = "inline";
}else
{
ooo.className = "before";
odiv.style.display = "none";
}
}
}
cc = setInterval('change()',3000);
</script>
</td>
上一个:javascript:R=0;x1=.1;y1=.05;x2=.25;y2=.24;x3=1.6;y3=.24;x4=300;y4=200;x5=300;y5=200;DI=document.imag
下一个:求高手详细解答JAVA循环体问题