图片翻页的幻灯效果

<SCRIPT LANGUAGE="JavaScript">

var rotate_delay = 1000; // delay in milliseconds (5000 = 5 secs)
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 == "Stop") ? "Start" : "Stop";
rotate();
}
function change() {
current = document.slideform.slide.selectedIndex;
document.images.show.src = document.slideform.slide[current].value;
}
function rotate() {
if (document.slideform.slidebutton.value == "Stop") {
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);
   }
}

</SCRIPT>
<form name="slideform">

<table cellspacing="1" cellpadding="4" bgcolor="#000000">
            <tr>
                <td align="center" bgcolor="white" width="200" height="200">
                    <img src="1.jpg" name="show">
                </td>
            </tr>
            <tr>
                <td align="center" bgcolor="#c0c0c0">
                    <select name="slide" onChange="change();">
                        <option value="1.jpg" selected>
                        1
                        <option value="2.jpg">
                        2
                        <option value="3.jpg">
                        3
                        <option value="4.jpg">
                        4
                        <option value="5.jpg">
                        5
                        <option value="6.jpg">
                        6
                        <option value="7.jpg">
                        7
                        <option value="1.jpg">
                        8
                        <option value="2.jpg">
                        9
                        <option value="3.jpg">3</option>
                    </select>
                </td>
            </tr>
            <tr>
                <td align="center" bgcolor="#c0c0c0">
                    <input type="button" onClick="first();" value="|<<" title="Beginning"> <input type="button" onClick="previous();" value="<<" title="Previous">
                    <input type="button" name="slidebutton" onClick="ap(this.value);" value="开始" title="AutoPlay">
                    <input type="button" onClick="next();" value=">>" title="Next"> <input type="button" onClick="last();" value=">>|" title="End">
                </td>
            </tr>
        </table>
 </form>

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值