手机端轮播图插件

手机端轮播图实现:

 

 

 

对应插件:af.carousel.js 见附件

 

使用方法:

Js代码   收藏代码
  1. /*** 
  2.  * 
  3.  * @param carouselId 
  4.  * @param carousel_dotsId 
  5.  * @param autoPlay : 是否自动播放轮播图 
  6.  * @param isCache : 不传值默认为true 
  7.  */  
  8. function carouselSetup(carouselId, carousel_dotsId, autoPlay, isCache) {  
  9.     // set size of carousel  
  10.     $(".carousel").width($(".carousel").closest(".panel").width());  
  11. //    $("#carousel").height($("#carousel").closest(".panel").height()-25);  
  12.     var moveCallback = function () {  
  13.         console.log(arguments);  
  14.     }  
  15.     var options={  
  16.         vertical:false// page up/down  
  17.         horizontal:true// page left/right  
  18.         pagingDiv:carousel_dotsId, // div to hold the dots for paging  
  19.         pagingCssName:"carousel_paging"//classname for the paging dots  
  20.         pagingCssNameSelected: "carousel_paging_selected"//classname for the selected page dots  
  21.         wrap:true//Creates a continuous carousel  
  22.         okToMove:true,  
  23.         pagingDotDivHeight:'10px',  
  24.         //isCache: false,  
  25.         moveCallback2/* this.carouselIndex, this.myDivHeight, this.myDivWidth, this.el.children */: moveCallback,  
  26.         autoTransitionIntervalTime:4000  
  27.     }  
  28.     if (arguments.length > 3 && !isCache) {  
  29.         options.isCache = false;  
  30.     }  
  31.     var carousel = $("#"+carouselId).carousel(options);  
  32.     if(arguments.length>2&&autoPlay){  
  33.         carousel.switchAuto();//自动播放  
  34.     }  
  35. }  

 

Js代码   收藏代码
  1. carouselSetup("pic_news_carousel""carousel_dots_picnews"falsefalse);  

 

 

Js代码   收藏代码
  1. carouselSetup("index_carousel","carousel_dots",true);//轮播图  

 

实例:http://123.57.250.51/ios_www/www/index.html (请用手机访问)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值