window.onload = function(){ /*初始化*/ var wWidth = document.documentElement.clientWidth; var wHeight = document.documentElement.clientHeight; var oBox = document.getElementById("box"); oBox.style.width = wWidth + 'px'; oBox.style.height = wHeight + 'px'; var oBtn = document.getElementById("btn_bt"); var oP = document.getElementById("content"); var timeStart = 0; var timeEnd = 0; function absorbEvent_(event) { var e = event || window.event; e.preventDefault && e.preventDefault(); e.stopPropagation && e.stopPropagation(); e.cancelBubble = true; e.returnValue = false; return false; } function preventLongPressMenu(node) { node.ontouchstart = absorbEvent_; node.ontouchmove = absorbEvent_; node.ontouchend = absorbEvent_; node.ontouchcancel = absorbEvent_; } preventLongPressMenu(oBtn); /*触摸事件*/ oBtn.addEventListener("touchstart",function(){ timeStart = (new Date()).valueOf(); oBtn.className = "active"; },false); oBtn.addEventListener("touchend",function(){ timeEnd = (new Date()).valueOf(); time = (timeEnd - timeStart)/1000; oBtn.className = ""; var text = ''; var text2 = ''; var title = ''; if(time >0 && time <= 0.6) { text = '