网站首页图片动态更换显示【Javascript】

news/2024/5/20 3:31:02/文章来源:https://blog.csdn.net/weixin_30398227/article/details/96743427

      以前写过一篇网站首页图片动态更换显示【Flash】 ,主要是介绍了一下网站首页常见的图片新闻更换程序。今天上网发现一个用Javascript脚本写的,效果也很是不错,来看一下:
circle_show.jpg
跟Flash版的几乎一样,看一下代码吧,主要是JS:

  1None.gif<html>
  2None.gif<head>
  3ExpandedBlockStart.gifContractedBlock.gif<style>dot.gifDIV.dLocBBS {dot.gif}{ PADDING-LEFT: 17px; FLOAT: left; PADDING-BOTTOM: 3px; WIDTH: 20.2%; PADDING-TOP: 3px }
  4ExpandedSubBlockStart.gifContractedSubBlock.gif    .ImgChange1 {dot.gif}{ FONT-WEIGHT: bold; FONT-SIZE: 12px; WIDTH: 100%; LINE-HEIGHT: 20px; TEXT-ALIGN: center }
  5ExpandedSubBlockStart.gifContractedSubBlock.gif         .LinkTD{dot.gif}{ padding-top:10px;padding-right:20px;}
  6ExpandedBlockEnd.gif        
</style>
  7None.gif</head>
  8None.gif<div class="ImgChange1" id="focusPic1" style="display:block">
  9None.gif<href="http://www.8spaces.com/bbs/40100/20414.html" target="_blank"><img width="370" height="222" border="0" alt="加州私人海滩随拍,美女眼花缭乱,应接不暇" src="http://www.8spaces.com/hpic/2007/6/1/b438669d-c8be-4ebd-ac53-c2748a6103b7.jpg" /><br /></a>
 10None.gif<href="http://www.8spaces.com/bbs/40100/20414.html" target="_blank">加州私人海滩随拍,美女眼花缭乱,应接不暇</a>
 11None.gif<table width="98.5%" border="0" cellpadding="0" cellspacing="1" align="center" style="margin:auto;clear:both;">
 12None.gif<tr align="center">
 13None.gif<td bgcolor="#ebebeb">&nbsp;</td>
 14None.gif<td width="26" style="color:#FFFFFF;" bgcolor="#0049A5">1</td>
 15None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(2)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">2</td>
 16None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(3)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">3</td>
 17None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(4)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">4</td>
 18None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(5)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">5</td>
 19None.gif</tr>
 20None.gif</table>
 21None.gif</div>
 22None.gif<div class="ImgChange1" id="focusPic2" style="display:none">
 23None.gif<href="http://www.8spaces.com/bbs/40101/19941.html" target="_blank"><img width="370" height="222" border="0" alt="梦寻香港电影拍摄场地,香港新况小记" src="http://www.8spaces.com/hpic/2007/6/1/e79b8456-fcb2-4e14-b48c-a8b7f9f2757d.jpg" /><br /></a>
 24None.gif<href="http://www.8spaces.com/bbs/40101/19941.html" target="_blank">梦寻香港电影拍摄场地,香港新况小记</a>
 25None.gif<table width="98.5%" border="0" cellpadding="0" cellspacing="1" align="center" style="margin:auto;clear:both;">
 26None.gif<tr align="center">
 27None.gif<td bgcolor="#ebebeb">&nbsp;</td>
 28None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(1)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">1</td>
 29None.gif<td width="26" style="color:#FFFFFF;" bgcolor="#0049A5">2</td>
 30None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(3)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">3</td>
 31None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(4)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">4</td>
 32None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(5)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">5</td>
 33None.gif</tr>
 34None.gif</table>
 35None.gif</div>
 36None.gif<div class="ImgChange1" id="focusPic3" style="display:none">
 37None.gif<href="http://www.8spaces.com/bbs/40103/20367.html" target="_blank"><img width="370" height="222" border="0" alt="北美车展花拍,看外国车展之差异" src="http://www.8spaces.com/hpic/2007/6/1/141e1dc0-1f70-48a3-83a0-5ffc1abc43fc.jpg" /><br /></a>
 38None.gif<href="http://www.8spaces.com/bbs/40103/20367.html" target="_blank">北美车展花拍,看外国车展之差异</a>
 39None.gif<table width="98.5%" border="0" cellpadding="0" cellspacing="1" align="center" style="margin:auto;clear:both;">
 40None.gif<tr align="center">
 41None.gif<td bgcolor="#ebebeb">&nbsp;</td>
 42None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(1)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">1</td>
 43None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(2)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">2</td>
 44None.gif<td width="26" style="color:#FFFFFF;" bgcolor="#0049A5">3</td>
 45None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(4)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">4</td>
 46None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(5)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">5</td>
 47None.gif</tr>
 48None.gif</table>
 49None.gif</div>
 50None.gif<div class="ImgChange1" id="focusPic4" style="display:none">
 51None.gif<href="http://www.8spaces.com/bbs/40103/20462.html" target="_blank"><img width="370" height="222" border="0" alt="传统民俗图文详解,你知道的有几个?" src="http://www.8spaces.com/hpic/2007/6/1/6a9b1fc2-baf7-4772-b903-6a7b8bab7b6b.jpg" /><br /></a>
 52None.gif<href="http://www.8spaces.com/bbs/40103/20462.html" target="_blank">传统民俗图文详解,你知道的有几个?</a>
 53None.gif<table width="98.5%" border="0" cellpadding="0" cellspacing="1" align="center" style="margin:auto;clear:both;">
 54None.gif<tr align="center">
 55None.gif<td bgcolor="#ebebeb">&nbsp;</td>
 56None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(1)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">1</td>
 57None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(2)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">2</td>
 58None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(3)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">3</td>
 59None.gif<td width="26" style="color:#FFFFFF;" bgcolor="#0049A5">4</td>
 60None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(5)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">5</td>
 61None.gif</tr>
 62None.gif</table>
 63None.gif</div>
 64None.gif<div class="ImgChange1" id="focusPic5" style="display:none">
 65None.gif<href="http://www.8spaces.com/bbs/40101/19714.html" target="_blank"><img width="370" height="222" border="0" alt="五月世界新闻图片精选,静观世界前亭落燕" src="http://www.8spaces.com/hpic/2007/6/1/2bfe9a5b-53de-45fa-89b9-8dec9c0ecdf6.jpg" /><br /></a>
 66None.gif<href="http://www.8spaces.com/bbs/40101/19714.html" target="_blank">五月世界新闻图片精选,静观世界前亭落燕</a>
 67None.gif<table width="98.5%" border="0" cellpadding="0" cellspacing="1" align="center" style="margin:auto;clear:both;">
 68None.gif<tr align="center">
 69None.gif<td bgcolor="#ebebeb">&nbsp;</td>
 70None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(1)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">1</td>
 71None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(2)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">2</td>
 72None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(3)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">3</td>
 73None.gif<td width="26" bgcolor="#9EC9EC" style="cursor:pointer" onclick="javascript:setFocus1(4)" onmouseover="this.style.color='#FFFFFF';this.style.backgroundColor='#0049A5'" onmouseout="this.style.color='#004AA7';this.style.backgroundColor='#9EC9EC'">4</td>
 74None.gif<td width="26" style="color:#FFFFFF;" bgcolor="#0049A5">5</td>
 75None.gif</tr>
 76None.gif</table>
 77None.gif</div>
 78ExpandedBlockStart.gifContractedBlock.gif<SCRIPT language="javascript">dot.gif
 79InBlock.gifvar nn;
 80InBlock.gifnn=2;
 81InBlock.gifsetTimeout('change_img()',2000);
 82InBlock.giffunction change_img()
 83ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
 84InBlock.gifif(nn>5) nn=1
 85InBlock.gifsetTimeout('setFocus1('+nn+')',4000);
 86InBlock.gifnn++;
 87InBlock.giftt=setTimeout('change_img()',4000);
 88ExpandedSubBlockEnd.gif}

 89InBlock.giffunction setFocus1(i)
 90ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
 91InBlock.gifselectLayer1(i);
 92ExpandedSubBlockEnd.gif}

 93InBlock.giffunction selectLayer1(i)
 94ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
 95InBlock.gifswitch(i)
 96ExpandedSubBlockStart.gifContractedSubBlock.gifdot.gif{
 97InBlock.gifcase 1:
 98InBlock.gifdocument.getElementById("focusPic1").style.display="block";
 99InBlock.gifdocument.getElementById("focusPic2").style.display="none";
100InBlock.gifdocument.getElementById("focusPic3").style.display="none";
101InBlock.gifdocument.getElementById("focusPic4").style.display="none";
102InBlock.gifdocument.getElementById("focusPic5").style.display="none";
103InBlock.gifbreak;
104InBlock.gifcase 2:
105InBlock.gifdocument.getElementById("focusPic1").style.display="none";
106InBlock.gifdocument.getElementById("focusPic2").style.display="block";
107InBlock.gifdocument.getElementById("focusPic3").style.display="none";
108InBlock.gifdocument.getElementById("focusPic4").style.display="none";
109InBlock.gifdocument.getElementById("focusPic5").style.display="none";
110InBlock.gifbreak;
111InBlock.gifcase 3:
112InBlock.gifdocument.getElementById("focusPic1").style.display="none";
113InBlock.gifdocument.getElementById("focusPic2").style.display="none";
114InBlock.gifdocument.getElementById("focusPic3").style.display="block";
115InBlock.gifdocument.getElementById("focusPic4").style.display="none";
116InBlock.gifdocument.getElementById("focusPic5").style.display="none";
117InBlock.gifbreak;
118InBlock.gifcase 4:
119InBlock.gifdocument.getElementById("focusPic1").style.display="none";
120InBlock.gifdocument.getElementById("focusPic2").style.display="none";
121InBlock.gifdocument.getElementById("focusPic3").style.display="none";
122InBlock.gifdocument.getElementById("focusPic4").style.display="block";
123InBlock.gifdocument.getElementById("focusPic5").style.display="none";
124InBlock.gifbreak;
125InBlock.gifcase 5:
126InBlock.gifdocument.getElementById("focusPic1").style.display="none";
127InBlock.gifdocument.getElementById("focusPic2").style.display="none";
128InBlock.gifdocument.getElementById("focusPic3").style.display="none";
129InBlock.gifdocument.getElementById("focusPic4").style.display="none";
130InBlock.gifdocument.getElementById("focusPic5").style.display="block";
131InBlock.gifbreak;
132ExpandedSubBlockEnd.gif}

133ExpandedBlockEnd.gif}

134None.gif
</SCRIPT>
135None.gif</html>

转载于:https://www.cnblogs.com/xpengfee/archive/2007/06/19/789725.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_715551.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

关于网站子目录绑定二级域名的方法(php网站手机端)

最近帮客户做zencart网站手机模板用到了二级域名&#xff0c;通过判断手机访问来调用二级目录程序&#xff0c;http://afish.cnblogs.com/ 怎么说都比 http://www.cnblogs.com/afish/ 看着舒服如果你的主机空间支持子目录绑定二级域名&#xff0c;这里介绍的是子目录绑定二级域…

今天打开一个网站 FSO对象实例创建失败

马克斯程序或asp程序stream对象实例创建失败解决办法现在越来越多的网站使用动态生成静态页的技术&#xff0c;就是信息在写入数据库的同时&#xff0c;使用系统的FSO组件来生成html格式的静态页&#xff0c;这样能提高用户的访问速度。这样系统在配置的时候&#xff0c;需要载…

【原创】Crystal report 实现打印-网站开发手记

最近开发电子商务系统&#xff0c;里边用到报表打印&#xff0c;批量打出订单&#xff0c;以前没有接触过报表&#xff0c;更别说打印了&#xff0c;今天搞定后&#xff0c;那来与大家交流。源代码如下&#xff1a;aspx:1<% Page Language"C#"AutoEventWireup&quo…

恐怖绝伦,SOPA和PIPA捅了网站窝!

今天刚一上外网&#xff0c;愕然发现N个网站同时出现了类似如下文字&#xff1a;Join the largest online protest in history: tell the US Congress to stop SOPA and PIPA now! 粗译成中文&#xff0c;即&#xff1a;加入有史以来最大的网上抗议&#xff0c;告诉美国国会&am…

stack overflow--技术问答网站

转自&#xff1a;http://baike.baidu.com/link?urleMR6Pwdk9IkauI5B3nZb2Yo3VUAcK6vQfrMpcSMPWqgH0ngqFkup3Gdr3t_s_yZe_UFwkR8c1pboaxhEuY-iwF_nGiUYHajEPMO6Y1kqWvT8aPz7a_T6t3a1vxyTccgKl_UIx1cU-6IP7qjre2ijtq Stack Overflow是一个与程序相关的IT技术问答网站。用户可以在…

多媒体开发之分场图像和交错图像interlacing---一个破解版的迅雷云点播网站

[-] 目录编辑描述编辑去交错方法编辑去交错源自电影的影像编辑去交错交错式影像编辑单一场去交错intra-field deinterlacing编辑场间去交错inter-field deinterlacing编辑动态适应性去交错motion adaptive deinterlacing编辑动态补偿去交错motion compensated deinterlacing编辑…

在RHEL5下构建LAMP网站服务平台之架设Discuz!论坛

安装Discuz!论坛程序所需安装包&#xff1a;Discuz_6.1.0_SC_UTF8.zip 和 UCenter_1.0.0_SC_UTF8.zip源码包下载地址&#xff1a;http://www.discuz.net 1.建立用于bbs论坛的数据库bbsdb及用户linux5234&#xff1a;#mysql -u root -p mysql>create database bbsdb; my…

PS网页设计教程III——在Photoshop中设计优雅的网站布局设计

作为编码者&#xff0c;美工基础是偏弱的。我们可以参考一些成熟的网页PS教程&#xff0c;提高自身的设计能力。套用一句话&#xff0c;“熟读唐诗三百首&#xff0c;不会作诗也会吟”。 本系列的教程来源于网上的PS教程&#xff0c;都是国外的&#xff0c;全英文的。本人尝试翻…

网站性能愈来愈差怎么办?

新的一年&#xff0c;你的老板或客户&#xff0c;是否曾和你抱怨公司的网站性能愈来愈差&#xff1f;网站大家都会写&#xff0c;自从有了 Visual Studio 之后&#xff0c;连你家楼下的正妹小喵和隔壁的王大婶都会写 ASP.NET。但同样的一个画面&#xff0c;背后的性能却可能是天…

欢迎访问我的个人网站

2019独角兽企业重金招聘Python工程师标准>>> 欢迎访问我的个人网站&#xff1a;肖国栋的 i 自留地。 由于两边更新比较麻烦&#xff0c;一些修改不再同步到这边。 转载于:https://my.oschina.net/goldenshaw/blog/875030

大型网站的 HTTPS 实践(二):HTTPS 对性能的影响

大型网站的 HTTPS 实践&#xff08;二&#xff09;&#xff1a;HTTPS 对性能的影响 1 前言 HTTPS 在保护用户隐私&#xff0c;防止流量劫持方面发挥着非常关键的作用&#xff0c;但与此同时&#xff0c;HTTPS 也会降低用户访问速度&#xff0c;增加网站服务器的计算资源消耗。 …

通过pfSense阻止对某个网站的访问

防火墙阻止对某个网站的访问是基本功能&#xff0c;在pfSense上阻止对某个网站的访问&#xff0c;通常可以通过别名和设置防火墙规则来完成。在本例中&#xff0c;我们来尝试阻止对新浪网&#xff08;www.sina.com&#xff09;的访问。查找域名解析地址添加别名设置防火墙规则检…

HTML5+CSS3+jQuery Mobile轻松构造APP与移动网站 (陈婉凌) 中文pdf扫描版

《HTML5CSS3jQuery Mobile轻松构造APP与移动网站》以HTML与CSS为主&#xff0c;配合jQuery制作网页&#xff0c;并搭配jQueryMobile制作移动网页&#xff0c;通过具体的范例从基础到高级循序渐进地讲解。全书首先介绍了HTML5网页开发和CSS网页美化&#xff0c;只要按本书的顺序…

如何在最段的时间内让搜索引擎收录一个新网站?

对于搜索引擎收录新网站真的没有一个准确的时间&#xff0c;有时快有时慢&#xff0c;快的建站当天就收录&#xff0c;慢的几个月都不被收录。虽然收录有快有慢&#xff0c;但我们也可以通过操作来加快搜索引索的收录。下面总结了一些方法或是技巧供大家参考&#xff01; 一、网…

Flickr 网站架构分析

1234567891011。。。。。。。。。。。。。。 LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_http_module modules/mod_proxy_http.so 。。。。。。。。。。。。。。。。。。。。 <Proxy …

Linux快速构建LAMP网站平台

1.1 问题本例要求基于Linux主机快速构建LAMP动态网站平台&#xff0c;并确保可以支撑PHP应用及数据库&#xff0c;完成下列任务&#xff1a; 1&#xff09;安装LAMP平台各组件&#xff0c;启动LAMP平台 软件包&#xff1a;httpd、mariadb-server、mariadb、php、php-mysql系统服…

php主页备案号底部中间,如何获取公安备案号?如何将公安备案号放到网站底部?...

一、网站公安备案显示&#xff1a;网站通过了公安局备案后需要将“网站公安机关备案编号及图标”放到网站底部&#xff0c;本教程将详细指导如何操作。效果图&#xff1a;二、获取公安备案号及链接通过了公安备案后&#xff0c;获取备案编号及链接的方法&#xff1a;登录公安机…

配置Apache虚拟主机,实现在一台服务器上运行多个网站

Apache虚拟主机实现有三种方法&#xff1a;1、通过不同的IP地址2、通过不同的域名3、通过不同的端口号1、通过不同的IP地址&#xff0c;解析不同的域名&#xff08;1&#xff09;给服务器增加IP&#xff08;另一个域名解析&#xff09;[roothttp ~]# ifconfig eth0:1 192.168.2…

如何下载一些网站本身不希望你下载的文件呢

如一些学习视频之类&#xff0c;如何下载呢&#xff0c;本文主要针对一些非程序员朋友&#xff0c;对于程序员朋友其实稍微模式点的就是下面提到的右击&#xff0c;复制下载地址 其实很简单&#xff0c;打开对应的网站&#xff0c;按F12&#xff0c;浏览器下方就会弹出一个好玩…

不可忽视的力量,插件主题网站

在当前Web2.0时代&#xff0c;Blog&#xff0c;RSS&#xff0c;Wiki等服务充斥着整个互联网。近日&#xff0c;用户个性化定制搜索巨头Google宣布&#xff0c;将向Web 开发人员开放Gadget框架&#xff0c;使其能够在自己的网页上增添Universal Gadget。 这意味这用户可以根据自…