代码驿站移动版
频道导航
HTML/Xhtml
CSS
JavaScript
HTML5
PHP教程
ASP.NET
正则表达式
AJAX
ThinkPHP
Yii
MySQL
MariaDB
Oracle
MongoDB
Redis
DedeCMS
PHPCMS
帝国CMS
WordPress
Discuz
其它CMS
Zend Studio
Sublime
Notepad
Dreamweaver
Windows
Linux
Nginx
Apache
IIS
CentOS
Ubuntu
Debian
网站优化
工具资源
PHP源码
ASP.NET源码
其它源码
图标素材
按钮素材
字体素材
DedeCMS模板
帝国CMS模板
PHPCMS模板
WordPress模板
Discuz!模板
单页模板
开发软件下载
服务器软件下载
广告投放
联系我们
版权申明
软件编程
网页前端
移动开发
数据库
服务器
脚本语言
PHP代码
JAVA代码
Python代码
Android代码
当前位置:
主页
> >
图片自动播放器脚本之家修正
时间:2021-01-19 12:04:08 | 栏目: | 点击:次
图片自动播放器脚本之家修正,可以兼容ff,发现些小问题,希望大家多多讨论,使用方法呢
复制代码
代码如下:
ImgName=new ImgArray(3);
ImgName[0]="4.jpg";
ImgName[1]="1.jpg";
ImgName[2]="2.jpg";
ImgName[3]="3.jpg";
只需修改上面的地方即可,加了图片预载,转载请写明出处,剩下的大家来完善吧
<html> <head> <meta http-equiv="Content-Language" content="zh-cn"> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>图片自动播放器脚本之家修正</title> <script language="JavaScript"> function $(objectId) { if(document.getElementById && document.getElementById(objectId)) { // W3C DOM return document.getElementById(objectId); } else if (document.all && document.all(objectId)) { // MSIE 4 DOM return document.all(objectId); } else if (document.layers && document.layers[objectId]) { // NN 4 DOM.. note: this won't find nested layers return document.layers[objectId]; } else { return false; } } var goid=0; var t=0; var imglen; function ImgArray(len) { this.length=len; } ImgName=new ImgArray(3); ImgName[0]="4.jpg"; ImgName[1]="1.jpg"; ImgName[2]="2.jpg"; ImgName[3]="3.jpg"; imglen=ImgName.length; var d=document; if (d.images){ if(!d.dxypp) var dxypp=new Array(); var j=d.dxypp.length; for(var ii=0;ii<imglen;ii++){ d.dxypp[j].src=ImgName[ii]; } } function playImg() { t_end=document.player.intsec.value; if (t==imglen) { t=0; } else {t++;} if (t==imglen) { t_end=10000; } if (goid==0){ if(document.all){ $("theimg").style.filter="blendTrans(Duration=1)"; $("theimg").filters[0].apply(); $("theimg").src=ImgName[t]; tIndex=t; $("theimg").filters[0].play(); }else{ $("theimg").src=ImgName[t]; } } mytimeout=setTimeout("playImg()",t_end); } function go(id){ if (id==1){ t=1; goid=0; playImg(); } else if(id==2){ goid=1; t=1; } else if(id==3){ goid=1; t-=1; if (t<=imglen) $("theimg").src=ImgName[t]; } else if(id==4){ goid=1; t+=1; if (t>0 && t<=imglen){$("theimg").src=ImgName[t];} else{ t=1; goid=1; playImg(); } } else{ goid=0; t=1; playImg(); } } </script> <style> body img{border:3px ridge gold; } td,body { color:#4b4b4b; font-size:12px; font-family:arial,sans-serif; } .photobox { border-top: 2px dotted #C6CFBD; border-left: 2px dotted #C6CFBD; border-right: 2px dotted #C6CFBD; border-bottom: 2px dotted #C6CFBD; } </style> </head> <body bgcolor="#FFFFFF" onload="playImg()"> <div align="center"> <center> <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="458"> <tr> <td width="458" align=center> <p align="center"><b><font color="#000000">网贝博客图片自动播放器 </font></b></td> </tr> <form name="player" method="post" action=""> <tr> <td> 播放频率: <select name="intsec"> <option value=1000>1秒</option> <option value=3000 Selected>3秒</option> <option value=5000>5秒</option> <option value=8000>8秒</option> <option value=10000>10秒</option> </select> <input type="button" value="开始" onClick="javascipt:go(1)"> <input type="button" value="停止" onClick="javascipt:go(2)"> <input type="button" value="上一张" onClick="javascipt:go(3)"> <input type="button" value="下一张" onClick="javascipt:go(4)"> <input type="button" value="关闭" onClick="javascipt:window.close ();"> </td> </tr> </form> <tr> <td width="458" class="photobox" align=center valign=middle> <center><img src="photoconver.jpg" name="theimg" border="0" id="theimg" style="cursor:hand" onClick="window.open(img.src);" onload="if(this.width>=400) this.width=400;"> </center> </tr> </table> </center> </div> <p> </p> </body> </html>
[Ctrl+A 全选 注:
引入外部Js需再刷新一下页面才能执行
]
您可能感兴趣的文章:
Powershell小技巧之通过EventLog查看近期电脑开机和关机时间
IDEA配置GIT的详细教程
提高页面加载速度的几个方法小结
易语言设置组合框项目数值的方法
VMware Workstation虚拟机安装操作方法
相关文章
05-15
易语言打开文件件网页的方法
05-15
X86汇编调试环境搭建的过程
05-15
使用navicat导入sql文件的方法步骤
05-15
Discuz!论坛install.php书写错误漏洞
05-15
路由器安全有关的目录
JQuery
VUE
AngularJS
MSSql
MySQL
MongoDB
Redis
Linux
Tomcat
Nginx
网站首页
广告投放
联系我们
版权申明
联系站长