Authored by xuqi

fastclick处理点击事件

... ... @@ -19,7 +19,8 @@
"lazyload": "1.9.5",
"iscroll": "5.1.2",
"mustache": "2.0.0",
"underscore": "1.6.0"
"underscore": "1.6.0",
"fastclick": "1.0.2"
},
"devDependencies": {
"expect.js": "0.3.1"
... ...
... ... @@ -6,6 +6,7 @@
var $ = require('jquery'),
Mustache = require('mustache'),
Fastclick = require('fastclick'),
ellipsis = require('mlellipsis');
require('lazyload');
... ... @@ -27,6 +28,9 @@ exports.init = function() {
canScroll = true,
tpl;
//fastclick
Fastclick(document.body);
//获取相关资讯模板
$.get('/ps/readTpl', function(data) {
if (data.success) {
... ... @@ -56,10 +60,7 @@ exports.init = function() {
$('#more-intro .more').css('visibility', 'hidden');
}
$('#more-intro').delegate('.more', 'touchstart', function(e) {
e.preventDefault();
showMoreIntro();
}).delegate('.more', 'click', function() {
$('#more-intro').delegate('.more', 'click', function() {
showMoreIntro();
});
... ...
... ... @@ -3,7 +3,8 @@
* @author: xuqi(qi.xu@yoho.cn)
* @date;2015/3/30
*/
var $ = require('jquery');
var $ = require('jquery'),
Fastclick = require('fastclick');
require('lazyload');
/**
... ... @@ -20,6 +21,9 @@ exports.init = function() {
containerH,
containerTop;
//fastclick
Fastclick(document.body);
/**
* 计算小箭头位置函数
* @param index(类型为number,调用函数li的index)
... ...
... ... @@ -7,6 +7,7 @@
var $ = require('jquery'),
_ = require('underscore'),
Mustache = require('mustache'),
Fastclick = require('fastclick'),
timer = null;
require('lazyload');
... ... @@ -64,6 +65,9 @@ exports.init = function() {
//加载更多
var winH = $(window).height();
//fastclick
Fastclick(document.body);
//read good-info template
$.get('/tpl/readTpl', function(data) {
if (data.success) {
... ... @@ -270,10 +274,7 @@ exports.init = function() {
}
//切换“最新”,“销量”,“价格”以及“筛选”功能
$('#goods-nav').delegate('.nav-item', 'touchstart', function(e) {
e.preventDefault();
navTouchEvt(e);
}).delegate('.nav-item', 'click', function(e) {
$('#goods-nav').delegate('.nav-item', 'click', function(e) {
navTouchEvt(e);
});
... ... @@ -301,10 +302,7 @@ exports.init = function() {
$('#sub-' + curType).removeClass('hide');
}
$('#screen-content').delegate('.c-item', 'touchstart', function(e) {
e.preventDefault();
scTouchEvt(e);
}).delegate('.c-item', 'click', function(e) {
$('#screen-content').delegate('.c-item', 'click', function(e) {
scTouchEvt(e);
});
... ...
... ... @@ -4,6 +4,7 @@ $pxConvertRem : 40;
body {
font-family: helvetica,Arial,"黑体";
background: #f0f0f0;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
ol, ul {
... ...
... ... @@ -192,7 +192,7 @@
> div {
height: 30rem / $pxConvertRem;
width: 30rem / $pxConvertRem;
border: 2px solid #f00;
border: 2px solid #000;
border-bottom-color: transparent;
}
}
... ...
@import "common/common", "common/brands", "common/good-info";
body {
background-color: #f0f0f0;
}
.template-container .tpl-block:first-child {
border-top: none;
}
... ...