非常优秀的swiper插件————幻灯片播放、图片轮播
http://www.swiper.com.cn/ Swiper中文网 2015-10-15
SuperSlide2: (这是个PC用的滚屏插件,看着不错,还没研究。) 2016-5-4
http://superslide2.com/ superslide2
http://www.superslide2.com/param.html api
API:
http://www.idangero.us/swiper/api/ 官网API
http://www.swiper.com.cn/api/index.html
var mySwiper = new Swiper('.swiper-container',{
onSlideChangeEnd: function(){//当滑块滚动完毕后调用
console.log(mySwiper.activeIndex);//当前滑块索引号
},
onSlideChangeStart: function(){//当滑块滚动开始调用
console.log(mySwiper.activeIndex);//当前滑块索引号
},
});
//mySwiper.onResize();//刷新swiper(不刷新会导致slide无法拖动的bug)
//mySwiper.slideTo(_index);//跳转到第几张图
//mySwiper.slideTo(_index,0);//跳转到第几张图(直接跳转,无滑动效果)
var mySwiper = new Swiper('.swiper-container',{
//pagination: '.pagination',
//loop:false,
grabCursor: true,
//paginationClickable: true,
mousewheelControl:true,//鼠标滚轮
//autoplay:2000,
//mode: 'vertical',//纵向滚动(这个好像不好使了 2016-1-15)
//direction: 'vertical',//纵向滚动(这个好用 2016-1-15)
onInit: function(mySwiper){//Swiper初始化了
//console.log("提示Swiper的当前索引 "+mySwiper.activeIndex);//提示Swiper的当前索引
},
});
mySwiper.slideTo(2);//跳转到第三个滑块
标准轮播图(含图片懒加载):
<script type="text/javascript" src="http://cdn.bootcss.com/jquery/1.11.2/jquery.min.js"></script>
<link href="http://cdn.bootcss.com/Swiper/3.1.7/css/swiper.css" rel="stylesheet">
<script src="http://cdn.bootcss.com/Swiper/3.1.7/js/swiper.min.js"></script>
<script type="text/javascript">
$(function(){
//轮播图
var mySwiper = new Swiper('.swiper-container',{
pagination: '.xgt-pagination', //导航小圆点
paginationClickable: true, //导航小圆点(可点击)
nextButton: '.swiper-button-next',//下一张按钮
prevButton: '.swiper-button-prev',//上一张按钮
//direction: 'vertical',//Slides的滑动方向:垂直
//autoplay : 3000,//自动切换的时间间隔(单位ms),不设定该参数slide不会自动切换
//speed:300,//滑动速度,即slider自动滑动开始到结束的时间(单位ms) loop: true, //可循环
grabCursor: true,//设置为true时,鼠标覆盖Swiper时指针会变成手掌形状,拖动时指针会变成抓手形状。(根据浏览器形状有所不同)
mousewheelControl:true,//鼠标滚轮
lazyLoading:true,//图片懒加载 http://www.swiper.com.cn/api/Images/2015/0308/213.html
onLazyImageLoad: function(swiper, slide, image){
//alert('延迟加载图片');
//console.log(swiper);//Swiper实例
//console.log(slide);//哪个slide里面的图片在加载
//console.log(image);//哪个图片在加载
}
});
});
</script>
<div class="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide"><img class="swiper-lazy" data-src="data:images/_1.jpg"></div>
<div class="swiper-slide"><img class="swiper-lazy" data-src="data:images/_2.jpg"></div>
<div class="swiper-slide"><img class="swiper-lazy" data-src="data:images/_3.jpg"></div>
</div>
</div>
一、 幻灯片播放、图片轮播————非常优秀的swiper插件,手机上支持手势滑动。 还可以支持鼠标滚轮,移动和PC端两相宜。
(而且轮播的内容不仅仅可以放一张图片,可以放多张,或者图文混排。支持自定制。)有兴趣的去看官方demo
http://www.swiper.com.cn/api/ API
初始化参数:
mousewheelControl:true, //支持鼠标滚轮
mode: 'vertical', //上下方向滚动
autoplay:2000, //2秒播放一张
pagination: '.pagination', //导航(指定导航的类)
paginationClickable: true, //导航(小圆点)可点击
loop:true, //可循环(最后一张可衔接第一张)
grabCursor: true, //滑块上加鼠标变小手的效果
lazyLoading:true, //图片懒加载
freeMode: true, //自由模式(设定此值后,每次可滚动在中间位置,不会每次只滚动一张图)
slidesPerView:4, //一屏内显示4个滑块
preloadImages:false, //强制预加载所有图片
翻页小圆点:
<div class="swiper-container tagjvhe-swiper">
<div class="swiper-wrapper cDGray f14">
<div class="swiper-slide"><a href="/news/"><img class="swiper-lazy" data-src="data:images/_tag1.jpg" alt="效果图片"></a><p>现代1居室内装饰设计效果图片<span class="r"><i class="iconfont icon27"></i><em>1/8</em></span></p></div>
<div class="swiper-slide"><a href="/news/"><img class="swiper-lazy" data-src="data:images/_tag2.jpg" alt="效果图片"></a><p>现代2居室内装饰设计效果图片<span class="r"><i class="iconfont icon27"></i><em>2/8</em></span></p></div>
<div class="swiper-slide"><a href="/news/"><img class="swiper-lazy" data-src="data:images/_tag3.jpg" alt="效果图片"></a><p>现代3居室内装饰设计效果图片<span class="r"><i class="iconfont icon27"></i><em>3/8</em></span></p></div>
<div class="swiper-slide"><a href="/news/"><img class="swiper-lazy" data-src="data:images/_tag4.jpg" alt="效果图片"></a><p>唐朝<span class="r"><i class="iconfont icon27"></i><em>4/8</em></span></p></div>
</div>
</div>
<div class="tagjvhe-pagination"></div> <style>
/*翻页小圆点*/
.tagjvhe-pagination {height:4px;}
.swiper-pagination-bullet {}
.swiper-pagination-bullet-active {background:#ff7200;}
</style>
var mySwiper = new Swiper('.swiper-container',{
//pagination: '.pagination',
//loop:true,
grabCursor: true,
paginationClickable: true,
mousewheelControl:true,//鼠标滚轮
autoplay:2000,
mode: 'vertical',/*纵向滚动*/
})
$('.arrow-left').on('click', function(e){/*向前*/
e.preventDefault();
mySwiper.slidePrev();
})
$('.arrow-right').on('click', function(e){/*向后*/
e.preventDefault();
mySwiper.slideNext();
})
http://www.idangero.us/sliders/swiper/index.php 插件主页
http://www.idangero.us/sliders/swiper/api.php 插件API (强大的API。 可用 http://fanyi.baidu.com 输入网址翻译)
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0;" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="format-detection" content="telephone=no" /> <!-- jquery库 -->
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<!-- <script src="js/zepto.min.js"></script> --> <!-- 图片轮播 -->
<!-- <link href="plugin/idangerous.swiper.css" rel="stylesheet" type="text/css" />
<script src="plugin/idangerous.swiper-2.0.min.js"></script> --> <link href="http://www.idangero.us/sliders/swiper/css/idangerous.swiper.css" rel="stylesheet" type="text/css" />
<script src="http://www.idangero.us/sliders/swiper/js/idangerous.swiper.js"></script> </head>
<body>
<style type="text/css">
.main{margin:0 auto;}
</style> <!-- 首页头条新闻(4张) -->
<!-- 图片轮播 -->
<div class="main" style="position:relative;">
<div class="swiper-container" id="swiper-container">
<div class="swiper-wrapper">
<div class="swiper-slide"><a href="news_detail.html?id=51"><img src="http://www.tmtpost.com/wp-content/uploads/2014/06/140291396214.jpg" border="0"></a><div class="title-bg"></div><div class="title"><a href="news_detail.html?id=48">幻灯片演示一</a></div></div>
<div class="swiper-slide"><a href="news_detail.html?id=50"><img src="http://www.tmtpost.com/wp-content/uploads/2014/06/140291396214.jpg" border="0"></a><div class="title-bg"></div><div class="title"><a href="news_detail.html?id=48">幻灯片演示222222222222</a></div></div>
<div class="swiper-slide"><a href="news_detail.html?id=49"><img src="http://www.tmtpost.com/wp-content/uploads/2014/06/140291396214.jpg" border="0"></a><div class="title-bg"></div><div class="title"><a href="news_detail.html?id=48">幻灯片演示3333333333333</a></div></div>
<div class="swiper-slide"><a href="news_detail.html?id=48"><img src="http://www.tmtpost.com/wp-content/uploads/2014/06/140291396214.jpg" border="0"></a><div class="title-bg"></div><div class="title"><a href="news_detail.html?id=48">幻灯片演示4444444444444</a></div></div>
</div>
<div class="my-pager"></div>
</div> </div> <style>
.swiper-wrapper{overflow:auto;zoom:1;}
.swiper-slide{position:relative;}
#swiper-container{width:680px;height:350px;}/*定义宽高*/
#swiper-container img{width:100%;}
#swiper-container a{color:#fff;text-decoration:none;}
#swiper-container .title{position:absolute;bottom:0;width:100%;height:30px;line-height:30px;color:#FFF;font-size:20px;z-index:2;}
#swiper-container .title-bg{position:absolute;bottom:0;width:100%;height:30px;background:#000;opacity:0.6;filter:alpha(opacity=60);z-index:1;} /*翻页小圆点*/
.my-pager {position: absolute;right:2%;text-align: right;bottom:0;height:30px;line-height:30px;z-index:100;}
.swiper-pagination-switch {display: inline-block;width: 8px;height: 8px;border-radius: 8px;background: #999;-webkit-box-shadow: 0px 1px 2px #555 inset;box-shadow: 0px 1px 2px #555 inset;margin: 0 3px;cursor: pointer;}
.swiper-active-switch {background: #fff;} </style>
<script>
$(function(){
var mySwiper = new Swiper('.swiper-container',{
pagination: '.my-pager',
autoplay:3000,
loop:true,
grabCursor: true,
paginationClickable: true
})
//var containerH=$("#swiper-container").find("img").first().height();
//$("#swiper-container").height(containerH); });
</script>
<!-- 图片轮播,end --> </body>
</html>
二、jQuery 3D圆盘旋转焦点图 支持鼠标滚轮
http://www.html5tricks.com/jquery-3d-circle-image-slider.html 2014-10-9
三、jQuery水平滑动焦点图插件 (这个不支持触屏拖动事件)
http://www.html5tricks.com/jquery-hor-image-slider.html 2014-10-10
非常优秀的swiper插件————幻灯片播放、图片轮播的更多相关文章
- jq插件处女座 图片轮播
好久没写博客了,变得好懒呀,无地自容.最近一直在学sass和jq插件的写法,照猫画虎的谢了一个jq的插件,也算是第一次真正称得上插件的插件 ,废话不多说 上代码 (function($) { $.fn ...
- jQuery插件slider实现图片轮播
1:引入相应的js文件 jquery.SuperSilder.js 2:HTML: 结构 注:此地加载图片的代码也可以从后台库中读取图片的集合列表,然后通过循环的方式显示出来 3:CSS 样式定义左 ...
- Javascript和jQuery WordPress 图片轮播插件, 内容滚动插件,前后切换幻灯片形式显示
用于在有限的网页空间内展示一组产品图片或者照片,同时还有非常吸引人的动画效果.本文向大家推荐12款实用的 jQuery 图片轮播效果插件,帮助你在你的项目中加入一些效果精美的图片轮播效果,希望这些插件 ...
- js实现幻灯片播放图片示例代码
幻灯片播放图片的效果想必大家都有见到过吧,下面有个不错的示例,感兴趣的朋友可以参考下 复制代码代码如下: <select id="img_date" style=" ...
- 12款经典的白富美型—jquery图片轮播插件—前端开发必备
图片轮播是网站中的常用功能,用于在有限的网页空间内展示一组产品图片或者照片,同时还有非常吸引人的动画效果.本文向大家推荐12款实用的 jQuery 图片轮播效果插件,帮助你在你的项目中加入一些效果精美 ...
- 原生JS实现"旋转木马"效果的图片轮播插件
一.写在最前面 最近都忙一些杂七杂八的事情,复习软考.研读经典...好像都好久没写过博客了... 我自己写过三个图片轮播,一个是简单的原生JS实现的,没有什么动画效果的,一个是结合JQuery实现的, ...
- 实现一个图片轮播-3d播放效果
前言:最近在做一个音乐播放器,首页要做一个图片轮播,看了bootstrap的carousel插件以及移动端的swipe.js库,都是平面图片轮播的效果,所以自己想着实现类似网易云app里那种3d图片轮 ...
- Nivo Slider - 世界上最棒的 jQuery 图片轮播插件
Nivo Slider 号称世界上最棒的图片轮播插件,有独立的 jQuery 插件和 WordPress 插件两个版本.目前下载量已经突破 1,800,000 次!jQuery 独立版本的插件主要有如 ...
- 图片轮播插件Nivo Slider
推荐:图片轮播插件Nivo Slider 因为项目需要一款切换样式多一些的轮播插件,不经意找到了NivoSlider,非常好用,比bootstrap要好用,而且样式丰富.值得注意的是, ...
随机推荐
- 从零开始学Shell(一)
1.$表示普通用户,#表示超级用户.2.sh /home/path/script.sh3.chmod a+x script.sh 增加可执行权限 ./script.sh #./表示当前的 ...
- Wampserver 403问题
使用Wampserver 2.4.23做反向代理时报403没有权限:是因为在升级到2.4之后的版本只修改httpd.conf文件不管用 正确步骤如下:1.修改httpd.conf 文件中的Requ ...
- 1095 解码PAT准考证
PAT 准考证号由 4 部分组成: 第 1 位是级别,即 T 代表顶级:A 代表甲级:B 代表乙级: 第 2~4 位是考场编号,范围从 101 到 999: 第 5~10 位是考试日期,格式为年.月. ...
- python 文件读写时用open还是codecs.open
当我面有数据需要保存时,第一时间一般会想到写到一个txt文件中,当然,数据量比较大的时候还是写到数据库比较方便管理,需要进行网络传输时要序列化,json化.下面主要整理一下平时用的最多的写入到文件中, ...
- echarts环形图自动定位radius
根据后台返回数据条数进行pie图radius定位: var a = 100; var b = 0; var c = 0; var radius = []; for (var i in data ...
- Socket网络编程入门
Socket:专业术语:套接字;通俗的解释:两孔插座(一个孔:IP地址,一个孔:端口号).使用场景:通信,如QQ好友交谈,如浏览器的进程怎么与web服务器通信等. Socket来历: socket起源 ...
- python int str
1. int 类型转换 a = "123" b = int(a) b = b+10 print(type(a),a) print(type(b),b) 2. int(num,bas ...
- java基础(1)IntelliJ IDEA入门和数组操作 解决idea启动速度慢--配置JVM
一. IntelliJ IDEA入门 1 快捷键和技巧 智能补全代码,比如只写首字母按回车: psvm+Enter :public stactic void main(String[] args) s ...
- 【leetcode】427. Construct Quad Tree
problem 427. Construct Quad Tree 参考 1. Leetcode_427. Construct Quad Tree; 完
- 软件工程 week 03
一.效能分析 1.作业地址:https://edu.cnblogs.com/campus/nenu/2016CS/homework/2139 2.git地址:https://git.coding.ne ...