jquery实现简单的自动播放幻灯片效果
2015-06-13 00:00
886 查看
本文实例讲述了jquery实现简单的自动播放幻灯片效果。分享给大家供大家参考。具体实现方法如下:
html部分:
<div id="slideshow"> <div> <img src="images/5224/5658667829_2bb7d42a9c_m.jpg"> </div> <div> <img src="images/5230/5638093881_a791e4f819_m.jpg"> </div> <div> Pretty cool eh? This slide is proof the content can be anything. </div> </div>
CSS部分:
/* Slides need to be absolutely positioned within the wrapper. This has a tiny bit of extra pizazz: */ #slideshow { margin: 50px auto; position: relative; width: 240px; height: 240px; padding: 10px; box-shadow: 0 0 20px rgba(0,0,0,0.4); } #slideshow > div { position: absolute; top: 10px; left: 10px; right: 10px; bottom: 10px; }
jQuery部分:
//Run after DOM is ready. $("#slideshow > div:gt(0)").hide(); setInterval(function() { $('#slideshow > div:first') .fadeOut(1000) .next() .fadeIn(1000) .end() .appendTo('#slideshow'); }, 3000);
希望本文所述对大家的jQuery程序设计有所帮助。
相关文章推荐
- JQUERY中QUEUE和DEQUEUE
- 类jquery选择器
- jQuery 效果函数,jquery文档操作,jQuery属性操作方法,jQuerycss操作函数,jQuery参考手册-事件,jQuery选择器
- Jquery ajax调用webservice总结
- 转 Jquery实际应用,判断radio,selelct,checkbox是否选中及选中的值
- jquery实现图片放大,缩小,翻转,旋转小实例
- 恶补jquery(四)jquery中事件--冒泡
- jQuery.extend 函数详解
- jQuery checkbox 全选
- phoneGap--jQuery Mobile--Html5的一些总结
- JQuery的Ajax跨域请求的
- jquery dataTable 自定义 Button及按钮事件
- jquery ztree 增加自定义属性
- 获取页面中所有 checkbox的对面,并获取它的值
- jQuery.Validate验证库
- jQuery开发之jQuery选择器一
- Jquery获取selelct选中值
- jquery -- 触屏设备touch事件
- jquery.easing.js 使用动画过度效果
- jquery -- 同时监听多个事件