HTML图片轮播代码

<div style="position:relative; top:-50px; left:240px;">
<a href="javascript:show(1)"><span id="I1" style="width:18px; text-align:left; background:gray">1</span></a>
<a href="javascript:show(2)"><span id="I2" style="width:18px;text-align:left;2</span></a>
<a href="javascript:show(3)"><span id="I3" style="width:18px;text-align:left;3</span></a>
<a href="javascript:show(4)"><span id="I4" style="width:18px;text-align:left;4</span></a>
<a href="javascript:show(5)"><span id="I5" style="width:18px;text-align:left;5</span></a>
<a href="javascript:show(6)"><span id="I6" style="width:18px;text-align:left;6</span></a></div>
<script language="javaScript">
var nowIndex=1;
var maxIndex=6;
function show(index)
{
if(Number(index)){
clearTimeout(theTimer);
nowIndex=index;
}
for(var i=1;i<(maxIndex+1);i++){
if(i==nowIndex)
{document.getElementById('pic'+nowIndex).style.display='';
document.getElementById('I'+nowIndex).style.backgroundColor='red';}
else
{document.getElementById('pic'+i).style.display='none';
document.getElementById('I'+i).style.backgroundColor='gray';}
}{
if(nowIndex==maxIndex)
nowIndex=1;
else
nowIndex++;
}
theTimer=setTimeout('show()',3000);
}
</script>
</div>
二、图片自动播放:
<div id="butong_net_left" style="overflow:hidden;width:1000px;">
<table cellpadding="0" cellspacing="0" border="0">
<tr><td id="butong_net_left1" valign="top" align="center">
<table cellpadding="2" cellspacing="0" border="0">
<tr align="center">
posted @ 2016-04-07 20:18  jhvgvfgx  阅读(1418)  评论(0编辑  收藏  举报