普通模式:(當前塊-之前塊)x寬度
move=(mySwiper.activeIndex-mySwiper.previousIndex)*mySwiper.width 。
free模式:現在第壹塊的相對swiper位置-滑動之前位置
onFirstInit: function(swiper){
location1=mySwiper.slides[0].getOffset().left;
}
其他事件{
location2=mySwiper.slides[0].getOffset().left;
move=location2-location1-mySwiper.positions.start;
}
swiper是個功能插件,使用在移動端,相當於jm,jq是javascript的框架庫,主用於平臺兼容,應用在比如連版廣告等需要滑動操作的地方,局限性比較小。