下面这段代码另存为.html,打开看可以浏览到效果
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 2</title>
</head>
<body>
<script language="JavaScript" type="text/javascript">
var rotate_delay = 1000; // 1000=1秒
current = 0;
function next() {
if (document.slideform.slide[current+1]) {
document.images.show.src = document.slideform.slide[current+1].value;
document.slideform.slide.selectedIndex = ++current;
}
else first();
}
function previous() {
if (current-1 >= 0) {
document.images.show.src = document.slideform.slide[current-1].value;
document.slideform.slide.selectedIndex = --current;
}
else last();
}
function first() {
current = 0;
document.images.show.src = document.slideform.slide[0].value;
document.slideform.slide.selectedIndex = 0;
}
function last() {
current = document.slideform.slide.length-1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
}
function ap(text) {
document.slideform.slidebutton.value = (text == "停止") ? "开始" : "停止";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}
function rotate() {
if (document.slideform.slidebutton.value == "停止") {
current = (current == document.slideform.slide.length-1) ? 0 : current+1;
document.images.show.src = document.slideform.slide[current].value;
document.slideform.slide.selectedIndex = current;
window.setTimeout("rotate()", rotate_delay);
}
}
function window.onload(){
document.images.show.src = document.slideform.slide[current].value;
document.images.show.onclick = owin;
}
function owin(url){
window.open(document.slideform.slide[current].link);
}
</script>
<table align="center" width="90%" bgcolor="#ffffff">
<tr>
<td height="20"></td>
</tr>
<tr>
<td>
<table cellspacing="0" cellpadding="0" align="center" border="0">
<form name="slideform">
<tr>
<td align="middle">
<img src="" border="0" name="show"></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="middle">
<select onchange="change();" name="slide">
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b0-a.jpg">
图01</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b1-a.jpg" >
图02</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b2-a.jpg" >
图03</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b3-a.jpg" >
图04</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b4-a.jpg" >
图05</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b5-a.jpg" >
图06</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b6-a.jpg" >
图07</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b7-a.jpg" >
图08</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b8-a.jpg" >
图09</option>
<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b9-a.jpg" >
图10</option>
</select></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td align="middle">
<input title="第一张" onclick="first();" type="button" value="|<<" name="button">
<input title="上一张" onclick="previous();" type="button" value="<<" name="button">
<input title="自动" onclick="ap(this.value);" type="button" value="开始" name="slidebutton">
<input title="下一张" onclick="next();" type="button" value=">>" name="button">
<input title="最后张" onclick="last();" type="button" value=">>|" name="button">
</td>
</tr>
<tr>
<td> </td>
</tr>
</form>
</tbody>
</table>
</td>
</tr>
</table>
</body>
</html>
我把<table> <script>中的内容放到Default.aspx的源中,然后把<option value="http://cn.yimg.com/sp/slideshow/biz/i20050429t110509b4-a.jpg" >
改成< optionvalue="image/1.gif">
。
。
。
。
< optionvalue="image/10.gif">
image 文件夹与Default.aspx在同级目录下面
怎么浏览不到效果呢,路径要怎么改啊,
哪位朋友指教下啊
[此贴子已经被作者于2006-9-28 0:42:59编辑过]