Authored by xuqi

click/touchstart -> tap

... ... @@ -15,7 +15,7 @@ $('#search-input').focus(function() {
$(this).blur();
});
$nav.delegate('li', 'touchstart', function() {
$nav.delegate('li', 'tap', function() {
var $this = $(this),
index = $this.index();
... ... @@ -30,7 +30,7 @@ $nav.delegate('li', 'touchstart', function() {
$curContent = $contents.eq(index).removeClass('hide');
});
$('.primary-level').delegate('li', 'touchstart', function() {
$('.primary-level').delegate('li', 'tap', function() {
var $this = $(this),
index = $this.index();
... ...
... ... @@ -56,7 +56,7 @@ info.initInfosEvt($infoList);
});
}());
$nav.delegate('.guang-nav-item', 'touchstart', function() {
$nav.delegate('.guang-nav-item', 'tap', function() {
var $this = $(this),
$content,
index;
... ...
... ... @@ -45,7 +45,7 @@ function setLazyLoadAndMellipsis($infos) {
* @params $container 逛资讯列表容器
*/
function initInfosEvt($container) {
$container.delegate('.like-btn', 'touchstart', function(e) {
$container.delegate('.like-btn', 'tap', function(e) {
var $likeBtn = $(e.currentTarget),
$info = $likeBtn.closest('.guang-info'),
opt = 'ok';
... ...
... ... @@ -37,7 +37,7 @@ setTimeout(function() {
info.initInfosEvt($infosContainer);
//文字介绍收起与展开
$('#more-intro').bind('touchstart', function() {
$('#more-intro').bind('tap', function() {
var $this = $(this);
$this.toggleClass('spread');
... ... @@ -56,7 +56,7 @@ $('#more-intro').bind('touchstart', function() {
});
//品牌收藏
$('#brand-like').bind('touchstart', function(e) {
$('#brand-like').bind('tap', function(e) {
var opt = 'ok',
$this = $(this);
... ...
... ... @@ -20,7 +20,7 @@ mySwiper = new Swiper('.swiper-container', {
pagination: '.swiper-pagination'
});
$('#nav-tab').delegate('li', 'touchstart', function() {
$('#nav-tab').delegate('li', 'tap', function() {
if ($(this).hasClass('focus')) {
return;
}
... ...
... ... @@ -6,13 +6,13 @@
var $ = require('yoho.zepto');
var $input = $('#search-input > input');
var $input = $('#search-input input');
var $clear = $('#search-input > .clear-input');
var $clear = $('#search-input .clear-input');
var $history = $('.history');
$('#clear-history').bind('touchstart', function() {
$('#clear-history').bind('tap', function() {
$.ajax({
type: 'POST',
url: '/search/clearHistory',
... ... @@ -32,6 +32,6 @@ $input.bind('input', function() {
}
});
$clear.bind('touchstart', function() {
$clear.bind('tap', function() {
$input.val('').trigger('input');
});
\ No newline at end of file
... ...
... ... @@ -33,7 +33,7 @@ function bindEyesEvt() {
$hasEye.append('<div class="eye close"></div>');
$eye = $hasEye.children('.eye');
$eye.on('touchstart', function(e) {
$eye.on('tap', function(e) {
var $this = $(this),
$pwd = $this.siblings('.pwd');
... ... @@ -58,7 +58,7 @@ function bindClearEvt() {
$hasClear.append('<div class="clear-input"></div>');
$clear = $hasClear.children('.clear-input');
$clear.on('touchstart', function(e) {
$clear.on('tap', function(e) {
var $input = $clear.siblings('.input');
$input.val('').trigger('input').focus();
... ...
... ... @@ -11,7 +11,7 @@ var $resend = $('#resend');
var tip = require('../../plugin/tip'),
showErrTip = tip.show;
$resend.on('touchstart', function(e) {
$resend.on('tap', function(e) {
e.preventDefault();
$.ajax({
... ...
... ... @@ -24,7 +24,7 @@ $email.bind('input', function() {
}
});
$btnSure.on('touchstart', function() {
$btnSure.on('tap', function() {
var email = trim($email.val());
if ($btnSure.hasClass('disable')) {
... ...
... ... @@ -32,7 +32,7 @@ $countrySelect.change(function() {
$areaCode.text($countrySelect.val());
});
$btnNext.on('touchstart', function() {
$btnNext.on('tap', function() {
var pn = trim($phoneNum.val()),
area = $countrySelect.val();
... ...
... ... @@ -45,7 +45,7 @@ module.exports = function(useInRegister) {
});
//重新发送验证码
$captchaTip.on('touchstart', function() {
$captchaTip.on('tap', function() {
if ($captchaTip.hasClass('disable')) {
return;
}
... ... @@ -70,7 +70,7 @@ module.exports = function(useInRegister) {
});
});
$btnNext.on('touchstart', function() {
$btnNext.on('tap', function() {
if ($btnNext.hasClass('disable')) {
return;
}
... ...
... ... @@ -64,7 +64,7 @@ $countrySelect.change(function() {
$areaCode.text($countrySelect.val());
});
$loginBtn.on('touchstart', function() {
$loginBtn.on('tap', function() {
var pn = trim($phoneNum.val()),
areaCode = $countrySelect.val(),
pwd = trim($pwd.val());
... ...
... ... @@ -68,7 +68,7 @@ $pwd.bind('input', function() {
// Login
$loginBtn.on('touchstart', function() {
$loginBtn.on('tap', function() {
var acc = trim($account.val()),
pwd = trim($pwd.val());
... ... @@ -107,15 +107,15 @@ $loginBtn.on('touchstart', function() {
});
$('#forget-pwd').on('touchstart', function() {
$('#forget-pwd').on('tap', function() {
showRetrivePanel();
});
$mask.on('touchstart', function() {
$mask.on('tap', function() {
hideRetrivePanel();
});
$('#cancel-retrive').on('touchstart', function(e) {
$('#cancel-retrive').on('tap', function(e) {
e.preventDefault();
hideRetrivePanel();
});
... ...
... ... @@ -24,7 +24,7 @@ $pwd.bind('input', function() {
}
});
$btnSure.on('touchstart', function() {
$btnSure.on('tap', function() {
var pwd = trim($pwd.val());
if ($btnSure.hasClass('disable')) {
... ...
... ... @@ -32,7 +32,7 @@ $countrySelect.change(function() {
$areaCode.text($countrySelect.val());
});
$btnNext.on('touchstart', function() {
$btnNext.on('tap', function() {
var pn = trim($phoneNum.val()),
areaCode = $countrySelect.val();
... ...
... ... @@ -33,7 +33,7 @@ function registerCbFn(cb) {
$classify.children(':first-child').addClass('active'); //T:不在HTML中使用{{#if @first}}active{{/if}}来初始化active为避免sub设置高度时的闪烁
//classify switch
$classify.delegate('.classify-item', 'touchstart', function() {
$classify.delegate('.classify-item', 'tap', function() {
var $this = $(this);
if ($this.hasClass('active')) {
... ... @@ -46,11 +46,11 @@ $classify.delegate('.classify-item', 'touchstart', function() {
});
//点击Mask隐藏筛选界面
$filter.filter('.filter-mask').click(function() {
$filter.filter('.filter-mask').tap(function() {
hideFilter();
});
$subClassify.delegate('li', 'click', function(e) {
$subClassify.delegate('li', 'tap', function(e) {
var $this = $(this),
id = $this.data('id');
... ...
... ... @@ -17,7 +17,7 @@ var $tip, tipItime;
$('.yoho-page').append(tipHtml);
$tip = $('#yoho-tip');
$tip.on('touchstart', function() {
$tip.on('tap', function() {
$tip.hide();
//清除Timeout
... ...
... ... @@ -210,7 +210,7 @@ filter.registerCbFn(search);
//3.筛选无active时点击展开筛选面板
//4.筛选有active时点击隐藏筛选面板并恢复点击筛选前active项的active状态
//5.当前active为筛选并且点击其他项时,隐藏筛选面板
$listNav.delegate('li', 'touchstart', function() {
$listNav.delegate('li', 'tap', function() {
var $this = $(this),
nav,
navType,
... ... @@ -309,19 +309,19 @@ $(window).scroll(function() {
});
//品牌介绍
$brandHeader.children('.btn-intro').bind('touchstart', function() {
$brandHeader.children('.btn-intro').bind('tap', function() {
$introBox.removeClass('hide');
});
$('.close-intro, .brand-intro-box').click(function() {
$('.close-intro, .brand-intro-box').tap(function() {
$introBox.addClass('hide');
});
$('#brand-intro').click(function(e) {
$('#brand-intro').tap(function(e) {
e.stopPropagation();
});
//品牌收藏
$brandHeader.children('.btn-col').bind('touchstart', function() {
$brandHeader.children('.btn-col').bind('tap', function() {
$(this).toggleClass('coled');
});
\ No newline at end of file
... ...
... ... @@ -10,7 +10,7 @@ var $cartContent = $('.cart-content');
require('./good');
$('.cart-nav').delegate('li', 'touchstart', function() {
$('.cart-nav').delegate('li', 'tap', function() {
var $this = $(this);
if ($this.hasClass('active')) {
... ...
... ... @@ -37,7 +37,7 @@ function remove() {
$('.chose-panel').remove();
}
$('.yoho-page').delegate('.chose-panel', 'touchstart', function(e) {
$('.yoho-page').delegate('.chose-panel', 'tap', function(e) {
var $cur = $(e.target);
if ($cur.closest('.main').length > 0) {
... ... @@ -46,10 +46,10 @@ $('.yoho-page').delegate('.chose-panel', 'touchstart', function(e) {
//点击蒙版消失
remove();
}).delegate('#chose-btn-sure', 'touchstart', function() {
}).delegate('#chose-btn-sure', 'tap', function() {
//确定
}).delegate('.block', 'touchstart', function() {
}).delegate('.block', 'tap', function() {
//尺寸颜色点选
var $this = $(this);
... ... @@ -60,7 +60,7 @@ $('.yoho-page').delegate('.chose-panel', 'touchstart', function(e) {
$this.siblings('.chosed').removeClass('chosed');
$this.addClass('chosed');
}).delegate('.btn-minus', 'touchstart', function() {
}).delegate('.btn-minus', 'tap', function() {
var num = +$num.val();
if (num === 1) {
... ... @@ -68,7 +68,7 @@ $('.yoho-page').delegate('.chose-panel', 'touchstart', function(e) {
}
$num.val(num - 1);
}).delegate('.btn-plus', 'touchstart', function() {
}).delegate('.btn-plus', 'tap', function() {
var num = +$num.val();
//TODO:库存数验证
... ...
... ... @@ -11,7 +11,7 @@ var chosePanel = require('./chose-panel');
lazyLoad($('.lazy'));
$('.gift-advance-page').delegate('.chose', 'touchstart', function() {
$('.gift-advance-page').delegate('.chose', 'tap', function() {
var id = $(this).closest('.gift-advance-good').data('id');
$.ajax({
... ...
... ... @@ -17,12 +17,12 @@ function docTouchEvt(e) {
$('.opt-panel:not(.hide)').addClass('hide');
//
$(document).unbind('touchstart', docTouchEvt);
$(document).unbind('tap', docTouchEvt);
}
}
// function unbindDocTouchEvt(e) {
// $(document).unbind('touchstart', docTouchEvt);
// $(document).unbind('tap', docTouchEvt);
// }
ellipsis.init();
... ... @@ -32,7 +32,7 @@ lazyLoad($('.lazy'));
$('.name')[0].mlellipsis(2);
//TIP:事件委托在.cart-goods,商品列表的容器统一需要有.cart-goods
$('.cart-goods').delegate('.checkbox', 'touchstart', function() {
$('.cart-goods').delegate('.checkbox', 'tap', function() {
var $this = $(this);
if ($this.hasClass('icon-cb-checked')) {
... ... @@ -40,7 +40,7 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() {
} else {
$this.removeClass('icon-checkbox').addClass('icon-cb-checked');
}
}).delegate('.icon-edit', 'touchstart', function() {
}).delegate('.icon-edit', 'tap', function() {
var id = $(this).closest('.shopping-cart-good').data('id');
$.ajax({
... ... @@ -55,13 +55,13 @@ $('.cart-goods').delegate('.checkbox', 'touchstart', function() {
}
}
});
}).delegate('.icon-del', 'touchstart', function(e) {
}).delegate('.icon-del', 'tap', function(e) {
e.stopPropagation();
$(this).closest('.shopping-cart-good').children('.opt-panel').removeClass('hide');
$(document).bind('touchstart', docTouchEvt);
}).delegate('.opt-panel', 'touchstart', function() {
$(document).bind('tap', docTouchEvt);
}).delegate('.opt-panel', 'tap', function() {
var $this = $(this),
id = $this.closest('.shopping-cart-good').data('id');
... ...