移動端開發(四):swiper.js

來源:互聯網
上載者:User

標籤:

swiper.js中文網:http://www.swiper.com.cn/

 

文檔結構

 

swiper.jquery.js    是需要引用jquery.js 或者 zepto.js 時,只需直接引用該檔案即可,減少載入。

swiper.animate.js  使用animate.js的動畫效果,使用方法:http://www.swiper.com.cn/usage/animate/index.html

 

基本使用方法

具體操作:http://www.swiper.com.cn/usage/index.html

1. 寫基本html標籤結構,結構中使用swiper.js的className;

2.書寫js時,可直接調用某功能,但是前提必須是具有該功能的html標籤存在在頁面中;

3.使用swiper.js的樣式,需應用swiper.css

 

API swiper.js版本3.0+  

具體API:http://www.swiper.com.cn/api/start/2014/1218/140.html

 1.初始化

var mySwiper = new Swiper(‘.swiper-contain‘,{   autoplay: 3000, // 自動滑動 })

 

2. Basic (swiper一般選項)

主要包含:初始設定,滑動方向,速度,自動播放,視差效果,隱藏顯示時的尺寸應用等。

 

3. Progress (進度)

標識silde的索引

 

4. Free Mode(free模式/抵抗反彈)

是否實現自動貼合,貼合期間的各個效果

 

5. Slide grid(網格分布)

 

 

properties 屬性

移動端開發(四):swiper.js

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.