图片翻页的幻灯效果
2007-06-21 18:16
309 查看
<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>
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>
相关文章推荐
- 图片翻页幻灯效果
- 图片翻页幻灯效果
- 图片翻页幻灯效果
- JS+CSS实现淡入式焦点图片幻灯切换效果的方法
- 使用fancy slide在drupal中添加幻灯图片效果
- jQuery 图片翻页展示效果 Awesome flipping page gallery
- js+css打造的仿土豆网带缩略图的图片幻灯切换效果
- 图片翻页效果引出的animate.css,很好玩,多动动吧~
- JS模仿腾讯图片站的图片翻页按钮效果完整实例
- 分享5个来自tympanus的超炫图片幻灯效果和教程
- JS切换图片幻灯切换效果
- 挑战1:使用jQuery生成水平图片幻灯效果
- 首页图片效果:翻页
- 使用viewpager嵌套实现上下左右滑动切换图片(IOS双向滚动翻页效果相同)
- [iphone开发私房菜_6_] 完美实现各种图片翻页浏览效果
- 调用图片幻灯切换效果js代码
- 使用viewpager嵌套实现上下左右滑动切换图片(IOS双向滚动翻页效果相同)
- 分享5个来自tympanus的超炫图片幻灯效果和教程
- 超棒片状过渡效果的jQuery图片幻灯插件 - jq-tiles
- 超棒片状过渡效果的jQuery图片幻灯插件 - jq-tiles