移動端觸屏幻燈片圖片切換插件idangerous swiper.js
強大的移動端觸屏幻燈片圖片和HTML內(nèi)容切換插件idangerous swiper,支持自定義左右切換還是上下切換,支持多個分組切換,支持下拉更新切換,支持TAB方式切換等十幾種切換效果,支持眾多的選項配置,如:
speed:切換的速度(毫秒)
autoplay:自動播放的速度
mode:切換模式 horizontal(橫向) vertical(豎向)
loop:是否循環(huán)播放true false
如此強大的配置功能,值得使用。
使用方法:
1.加載插件
<link rel="stylesheet" href="path_to_css/idangerous.swiper.css"> <script defer src="path_to_js/idangerous.swiper-2.x.min.js"></script>
2.HTML內(nèi)容
<div class="swiper-container"> <div class="swiper-wrapper"> <!--First Slide--> <div class="swiper-slide"> <!-- Any HTML content of the first slide goes here --> </div> <!--Second Slide--> <div class="swiper-slide"> <!-- Any HTML content of the second slide goes here --> </div> <!--Third Slide--> <div class="swiper-slide"> <!-- Any HTML content of the third slide goes here --> </div> <!--Etc..--> </div> </div>
3.函數(shù)調(diào)用
<script type="text/javascript"> window.onload = function() { var mySwiper = new Swiper('.swiper-container',{ //Your options here: mode:'horizontal', loop: true //etc.. }); } </script>
插件支持jQuery和Zepto,如果使用這兩者,請先加載jQuery.js
<script type="text/javascript"> $(function(){ var mySwiper = $('.swiper-container').swiper({ //Your options here: mode:'horizontal', loop: true //etc.. }); }); </script>
源碼下載:idangerous swiper.js
以上就是本文的全部內(nèi)容,希望對大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。
相關(guān)文章
javascript實現(xiàn)日歷控件(年月日關(guān)閉按鈕)
經(jīng)常使用google的朋友一定對google絢麗的日歷控件記憶猶新吧,那我們也來實現(xiàn)一個,雖然功能和效果比不上,但重要的是實現(xiàn)的過程2012-12-12JavaScript 字符串數(shù)字左補位,右補位,取固定長度,截位擴展函數(shù)代碼
這篇文章主要介紹了JavaScript 字符串數(shù)字左補位,右補位,取固定長度,截位擴展函數(shù)代碼,需要的朋友可以參考下2017-03-03JavaScript 定義function的三種方式小結(jié)
JavaScript中定義function有以下三種方式.2009-10-10