- 浏览: 286778 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
kane0409:
NB,解决了,我是把里面两个文件夹中的文件单独复制到eclip ...
解决initializing java tooling(1%) -
string2020:
那如果不采用Tomcat容器认证,怎么办?
Tomcat Session共享 -
hety163:
删除当前工作目录下的WORKSPACE/.metadata/. ...
解决initializing java tooling(1%) -
fox13754888170:
害的我好惨啊 每天工具不动弹 领导还以为我偷懒呢。。。。 ...
解决initializing java tooling(1%) -
ywc123zk:
十分感谢,myeclipse8.0也出现这种情况,用你的方法解 ...
解决initializing java tooling(1%)
很多网站上多有轮转图片,有的是用flash的,有的是用js的,前几天用了timers这个插件,感觉很不错,就试着写一下轮转图片。
<html> <head> <title>Round Images</title> <script type="text/javascript" src="js/jquery-1.3.1.js"></script> <script type="text/javascript" src="js/jquery.timers.js"></script> <script type="text/javascript"> $(document).ready(function(){ var imgobj = $("#pic li a img"); var img0 = imgobj[0].src; var text0 = imgobj[0].title; var imgIndex = 0; $("#text").html(text0); var numul = ""; for(var i=0;i<imgobj.length;i++){ if(i==0){ numul +="<li class='on'>"+(i+1)+"</li>"; }else{ numul +="<li>"+(i+1)+"</li>"; } }; $("#num").html(numul); var numobj = $("#num li"); $("#num li").click(function(){ var liobj = $(this); $("#num li").removeClass(); liobj.addClass("on"); changeImg(liobj.text()-1); imgIndex = liobj.text()-1; $(document).stopTime(); $(document).everyTime(3000, every); }); $(this).everyTime(3000, every); function changeImg(index){ if(index == 0){ $(imgobj[0]).attr({src:img0,title:text0}).css({opacity: 0.1}).animate({opacity: 1.0},1000); }else{ $(imgobj[0]).attr({src:$(imgobj[index]).attr("src"),title:$(imgobj[index]).attr("title")}).css({opacity: 0.1}).animate({opacity: 1.0},1000); } $("#text").html($(imgobj[0]).attr("title")); } function every(){ imgIndex = (imgIndex+1)%imgobj.length; numobj.removeClass(); $(numobj[imgIndex]).addClass("on"); changeImg(imgIndex); } }); </script> <style type="text/css"> * { margin:0; padding:0; } img,img a { border:0; } body { height:900px; border:1px red solid; } .focus { width:400px; height:360px; position:relative; border:1px solid #D8D9DA; } /*标题*/ .newindex_flash_bt { width:100%; height:35px; position:absolute; bottom:0px; left:0px; background:#000; -moz-opacity:0.5; filter:alpha(opacity=50); z-index:1; } /*广告*/ .newindex_flash_btfont { width:90%; height:35px; position:absolute; bottom:0px; left:10px; z-index:2; color:#fff; padding:0px 30px 0px 50px; background:url(../images/foc.gif) no-repeat 0px 10px; line-height:33px; font-weight:bold; } .newindex_flash_btfont a { color:#fff; } .newindex_flash_btfont a:visited { color:#fff; } .newindex_flash_btfont span { margin-left:15px; } .container, .container img { width:400px; height:360px; } .container { border:0px solid #333; } .container img { border:0; } .bottom { position:absolute; bottom:0px; width:400px; filter: Alpha(Opacity=60); opacity: 0.6; background-color:#000; height:30px; line-height:30px; } .text { float:left; padding-left:5px; font-size:14px; color:#fff !important } .num { float:right; padding-right:5px; margin:5px; } .num li { float:left; list-style:none; color: #fff; text-align: center; line-height: 16px; width: 16px; height: 16px; font-family: Arial; font-size: 12px; cursor: pointer; margin:1px; border: 1px solid #707070; background-color: #000; } .num li.on { line-height: 18px; width: 18px; height: 18px; font-size: 14px; border: 0; background-color: #FEC702; font-weight: bold; } .pic { width:400px; height:360px; overflow:hidden; } .pic li { list-style:none; } </style> </head> <body> <div class="focus" style="left:200px;top:100px;"> <div class="container" id="idContainer2"> <ul class="pic" id="pic"> <li> <a href="http://www.g.cn" target="_blank"> <img src="images/1.jpg" alt="图片1" width="400px" height="360px" title="图片1" /> </a> </li> <li> <a href="http://www.163.com" target="_blank"> <img src="images/2.jpg" alt="图片2" width="400px" height="360px" title="图片2" /> </a> </li> <li> <a href="http://www.sina.com" target="_blank"> <img src="images/3.jpg" alt="图片3" width="400px" height="360px" title="图片3" /> </a> </li> <li> <a href="http://www.baidu.com" target="_blank"> <img src="images/4.jpg" alt="图片4" width="400px" height="360px" title="图片4" /> </a> </li> <li> <a href="http://www.51aspx.com" target="_blank"> <img src="images/5.jpg" alt="图片5" width="400px" height="360px" title="图片5" /> </a> </li> <li> <a href="http://www.caidao8.com" target="_blank"> <img src="images/6.jpg" alt="图片6" width="400px" height="360px" title="图片6" /> </a> </li> </ul> <div class="bottom"> <div class="text" id="text"></div> <ul class="num" id="num"> </ul> <div style="clear:both;"></div> </div> </div> </div> </body> </html>
有一个缺陷就是在图片轮转的时候,只有简单的淡显效果,什么百叶窗等效果如果有人会的告诉我一声,谢谢
- 轮转图片.rar (531.6 KB)
- 下载次数: 87
发表评论
-
IE8下getElementsByName的问题
2011-07-11 12:43 1180在IE8下getElementsByName(name)获取 ... -
JS解决PNG图片在IE6下不透明的问题
2010-12-20 13:20 3924可恶的IE6,各种阻碍,各种难,中国还是IE6消亡最大的障碍, ... -
jquery操作select
2010-08-05 14:24 1383获取选中项的值 $jq("#mselect op ... -
JS时间格式化(短日期)
2010-08-05 14:21 2459JS时间格式化(短日期),如new Date() 转成2010 ... -
Javascript垂直方向轮播
2010-06-04 17:56 3175<style type="text/c ... -
javascript判断浏览器核心
2010-05-31 13:07 1284/** * 判断浏览器核心 * @return I ... -
jquery.autocomplete的使用
2010-05-17 15:04 1315$jq(document).ready(functio ... -
Jquery 实现复制到剪贴板
2010-03-04 09:21 11544不兼容Firefox <html> < ... -
Jquery文档处理的几种效果
2010-02-21 16:40 960Jquery文档处理的几种效果 <html> ... -
Jquery的几种动态效果(animate)
2010-02-02 16:43 2563<html> <head> & ... -
Jquery show hide toggle
2010-02-01 18:41 2866<html> <head> & ... -
兼容FireFox和IE8的设为首页和添加收藏
2010-02-01 18:40 1299设置首页和添加收藏是很常用的JS脚本,但是我以前经常用的那些脚 ... -
Jquery表单验证
2010-02-01 12:52 1815首先加一段HTML代码: <!DOCTYPE HTM ... -
JQuery实现淡入淡出效果
2010-01-29 17:51 2587以前一直用JavaScript,现在发现了Jquery的UI简 ... -
动态设置Ckeditor的尺寸
2010-01-27 11:55 1559<input type='textarea' i ... -
js实现拖动层,兼容IE/FireFox
2010-01-22 11:19 1514先添加一个div层 <div id='pop-ed ... -
JQuery找控件
2010-01-22 09:21 1353先将Jquery的包含进来 $("#&q ... -
收藏的JavaScript树(11种)
2010-01-20 13:39 818http://www.jb51.net/web/21947.h ... -
调用CkEditor
2010-01-19 14:20 1176首先包含以下js <script language= ... -
CKeditor配置大全
2010-01-19 12:12 17368第一步:基本配置 CKEditor + CKFinder ...
相关推荐
jquery.timers-1.2.js 定时器插件
jQuery Timers - jQuery定时器插件
jquery资源 ,jquery.timers定时器资源
jquery_timers实现带暂停功能的全屏相册实例源码,供大家一起参考学习。
jQuery Timers 是一个用来封装 setTimeout 和 setInterval 方法的 jQuery 定时器插件。
jquery_timers实现带暂停功能的全屏相册 /* http://www.haogongju.net/art/1036242 jQuery Timers 是一个用来封装 setTimeout 和 setInterval 方法的 jQuery 定时器插件。 提供了三个函式 1. everyTime(时间间隔, ...
jQuery timers定时器简单易懂。。 直接调用,时间设置可以自己修改
适用于网页自动执行去后台请求方法
jquery.colorbox:完美的jquery弹出层支持图片播放 jquery.contextmenu.r2:jquery右键菜单 jquery.cookie:jquery Cookie操作 jquery.form:jquery表单提交(ajax方式或其它方式自定) jquery.idTabs:jquery选项卡...
实现了图片轮播功能,jquery插件名称为zoeDylan.ImgChange,图片路径、跳转链接、提示标题都是有动态数组来配置,jquery插件可灵活配置6个参数, height高、width宽、mgs图片地址、links点击地址、tips图片说明、...
NULL 博文链接:https://justcoding.iteye.com/blog/545893
先去官网下载jQuery Timers插件 ,然后引用到html中。这里是1.2 version 代码如下: [removed][removed] 然后是HTML,我们可以放一个hidden 的server control存值用,当然这个随你了。 代码如下: ”hicurrenttime” ...
一款优良的第三方库文件,大家多多支持,只需要2积分,谢打赏
smoothie, Android listview/gridview的[DEPRECATED] 轻松异步加载 注:smoothie的API还不是最终的。 虽然库是相当funcional的,但仍然是beta质量代码。 不要仅仅依赖于生产代码。 欢迎使用反馈 !...
大家都知道jQuery很强大,也有很多效果很帅的插件,下面介绍下jQuery定时器插件jQuery Timers,那JS都自带有定时器,为什么要使用Jquery的呢?
timers定时器实现javascrip定时或按钮控制功能 floatbox浮动层实现javascript弹出浮动窗口功能 ...ImageFlyout弹出图片实现javascript放大图片功能 accordion折叠菜单实现Javascript展开收缩菜单功能
c# Timers简单的定时应用 对入门学的有用