网页图片轮播代码
(同时适用SharePointDesigner)
<script language="javascript">
j=0;
function show(){
for(ii=1;ii<6;ii++)
{
ElementById("pic"+ii).style.display="none";
ElementById("Submit"+ii).style.backgroundColor='';
}
j++
if(j==6){
j=1;
}
ElementById("pic"+j).style.display="block";
ElementById("Submit"+j).style.backgroundColor='blue';
a=setTimeout('show()',1000);
}
function pic(pic){
clearTimeout(a);
for(var i=1;i<=5;i++){
if(i==pic){
ElementById("pic"+pic).style.display="block";
ElementById("Submit"+pic).style.backgroundColor='blue';
j=i
}else {
ElementById("pic"+i).style.display="none";
ElementById("Submit"+i).style.backgroundColor='';
}
}
a=setTimeout('show()',1000);
}
js实现轮播图最简代码</script>
<style type="text/css">
input{ background-color:white; border:#FF0000
border: 0px;
margin: 0px;
padding: 0px;
height: 20px;
width: 20px;
font-size: 14px;}
</style>
<body onLoad="show()">
<table width="461" height="163">
<tr>
<td width="426" rowspan="7">
<img id="pic3" src="image/class1-2.jpg" >
<img id="pic1" src="image/class1-3.jpg">
<img id="pic2" src="image/class1-1.jpg">
<img id="pic4" src="image/class1-4.jpg">
<img id="pic5" src="image/class1-5.jpg"></td>
<td height="15"> </td>
</tr>
<tr>
<td><input type="button" name="Submit1" value="1" onClick="pic('1')"></td>
</tr>
<tr>
<td><input type="button" name="Submit2" value="2" onClick="pic('2')" /></td>
</tr>
<tr>
<td><input type="button" name="Submit3" value="3" onClick="pic('3')" /></td>
</tr>
<tr>
<td><input type="button" name="Submit4" value="4" onClick="pic('4')" /></td>
</tr>
<tr>
<td><input type="button" name="Submit5" value="5" onClick="pic('5')" /></td>
</tr>
<tr>
<td height="15"> </td>
</tr>
</table>
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。
发表评论