Authored by 陈峰

去除alloytouch

... ... @@ -6,6 +6,7 @@
//加载css
require("layout/_loading.css")
require("layout/_utils.css")
require("layout/_swiper.css")
require("common/_filter.css")
require("common/_good.css")
... ... @@ -55,7 +56,6 @@ require("channel/_vip-only.css")
var $ = require('yoho-jquery'),
Swiper = require('yoho-swiper'),
alloytouch = require('alloytouch'),
lazyLoad = require('yoho-jquery-lazyload'),
fastclick = require('yoho-fastclick'),
noticeScroll = require('../plugin/notice-scroll'),
... ... @@ -152,57 +152,17 @@ highlight($subNav);
// 头部banner轮播
if ($('.banner-alloy').find('img').size() > 1) {
new alloytouch({
touch:".banner-alloy",//反馈触摸的dom
vertical: false,//不必需,默认是true代表监听竖直方向touch
target: $('.alloy-wrapper')[0], //运动的对象
property: "translateY", //被运动的属性
change:function(){ }, //不必需,属性改变的回调。alloytouch.css版本不支持该事件
touchStart:function(value){ },
touchMove:function(value){ },
touchEnd:function(evt, v, index){
var step_v = index * this.step * -1;
var dx = v - step_v;
console.log(v)
if (Math.abs(dx) < 30) {
this.go(step_v);
}
else if (dx > 0) {
this.go(step_v + this.step);
} else {
this.go(step_v - this.step);
}
return false;
},
animationEnd:function(v, page){
var i = 0,
len = items.length;
for (; i < len; i++) {
if (i === page) {
items[i].classList.add("active");
} else {
items[i].classList.remove("active");
}
}
} //运动结束
})
// new Swiper('.banner-swiper', {
// lazyLoading: true,
// lazyLoadingInPrevNext: true,
// loop: true,
// autoplay: 3000,
// autoplayDisableOnInteraction: false,
// paginationClickable: true,
// slideElement: 'li',
// pagination: '.banner-top .pagination-inner'
// });
if ($('.swiper-wrapper').find('li').size() > 1) {
new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
autoplay: 3000,
autoplayDisableOnInteraction: false,
paginationClickable: true,
slideElement: 'li',
pagination: '.banner-top .pagination-inner'
});
}
// 店铺推荐人数和收藏初始查询
... ...
... ... @@ -55,16 +55,3 @@
}
}
}
.banner-alloy {
width: 100%;
overflow: hidden;
position: relative;
max-height: 312px;
.alloy-wrapper {
position: relative;
max-height: 312px;
img {
display: initial;
}
}
}
... ...