Authored by 梁志锋

update

... ... @@ -16,7 +16,9 @@ var searchH = $('.newbrand-search').outerHeight(),
headerH = $('.yoho-header').outerHeight(),
brandSwipe = parseInt(searchH) + parseInt(headerH) - 1;
var myHammer;
var myHammer, searchBtnHammer, clearTextHammer;
var $rightBarCon = $('#right-bar .con').find('b').unbind();
swiper = new Swiper('.swiper-container', {
lazyLoading: true,
... ... @@ -52,14 +54,15 @@ if ($brandList.length > 0) {
});
}
if ($('#right-bar .con').find('b').unbind()[0]) {
myHammer = new Hammer($('#right-bar .con').find('b').unbind()[0]);
if ($rightBarCon[0]) {
myHammer = new Hammer($rightBarCon[0]);
myHammer.on('tap', function(e) {
var index = $(this).index();
var index = $rightBarCon.index();
if ($('.bar-' + index).size() > 0) {
document.body.scrollTop = parseInt($('.bar-' + index)[0].offsetTop) - parseInt(brandSwipe - 1);
}
e.srcEvent.stopPropagation();
});
}
... ... @@ -87,19 +90,31 @@ $('#keyword').on('keyup', function() {
$('.search-action').hide();
});
$('#search-btn').on('tap', function() {
// $('#search-btn').on('tap', function() {
// searchResult(1);
// });
searchBtnHammer = new Hammer($('#search-btn')[0]);
searchBtnHammer.on('tap', function(e) {
searchResult(1);
e.srcEvent.stopPropagation();
});
$('.clear-text').on('tap', function() {
// $('.clear-text').on('tap', function() {
// $('#keyword').val('').trigger('input');
// });
clearTextHammer = new Hammer($('.clear-text')[0]);
clearTextHammer.on('tap', function(e) {
$('#keyword').val('').trigger('input');
e.srcEvent.stopPropagation();
});
$('form.search-box').on('submit', function() {
return false;
});
$('.clear-history').on('tap', function() {
$('.clear-history').on('touchstart', function() {
// setcookie('h_brands', '', {
// expire: -1,
... ...
... ... @@ -60,6 +60,7 @@ if (lifestyleType) {
$curNav = $this;
$(document).trigger('scroll'); //Trigger lazyLoad
e.srcEvent.stopPropagation();
});
}
... ...
... ... @@ -11,9 +11,11 @@
lazyLoad($('img.lazy'));
goodsSwiper = new Swiper('.banner-swiper', {
lazyLoading: true,
lazyLoadingInPrevNext: true,
loop: true,
pagination: '.banner-top .pagination-inner',
slideElement: 'div',
paginationClickable: true,
pagination: '.swiper-pagination'
nextButton: '.swiper-button-next',
prevButton: '.swiper-button-prev'
});
\ No newline at end of file
... ...
... ... @@ -341,6 +341,7 @@ navHammer.on('tap', function(e) {
search();
}
}
e.srcEvent.stopPropagation();
});
$(window).scroll(function() {
... ...
... ... @@ -358,6 +358,7 @@ navHammer.on('tap', function(e) {
search();
}
}
e.srcEvent.stopPropagation();
});
$(window).scroll(function() {
... ...