在我所知道的web开发中,Web技术涉及的内容相当广泛,本书涵盖了其中诸多方面,如:HTML标识语言、Java、Applet、CGI、脚本语言、ASP和JSP技术等。
我具体总结了以下几点:
解决方案:
//1.自己写一个fn-->myclick,然后onclick="myclick();"调用。
var t1 = null;//这个设置为全局
function myclick(){
if (t1 == null){
t1 = new Date().getTime();
}else{
var t2 = new Date().getTime();
if(t2 - t1 < 500){
t1 = t2;
return;
}else{
t1 = t2;
}
}
/*自己的代码*/
}
//2.上面的代码,也可以写在iscroll.js(4.2.5)的_end方法中,要注意var t1是全局的
//3.国外论坛在iscroll.js(4.2.5)对应位置添加
topOffset: 0,
checkDOMChanges: false, // Experimental
handleClick: true,
preventGhostClick: false, // prevent ghost clicks?防止2次点击
ghostClickTimeout: 500, // timeout for ghost click prevention设置时间差
/**
* Prevents any real clicks.
* See preventGhostClick portion of _end().
*/
_preventRealClick: function(e) {
if (e._fake !== true) {
e.preventDefault();
e.stopPropagation();
e.stopImmediatePropagation();
e.cancel = true;
return false;
}
},
_end: function (e) {......
ev._fake = true;
if (that.options.preventGhostClick) { //preventGhostClick: true,
// prevent ghost real clicks on body
document.body.addEventListener('click', that._preventRealClick, true);
// until ghost click timeout expires
setTimeout(function () {
document.body.removeEventListener('click', that._preventRealClick, true);
}, that.options.ghostClickTimeout);
}
target.dispatchEvent(ev);
//4.使用zepto的tap替换click
随着人们对用户体验的要求越来越高,前端开发的技术难度越来越大,Web前端开发工程师这一职业终于从设计和制作不分的局面中独立出来。