微信下拉露底这个操作在有些项目上不合适,所以整理了一下解决方法
//触屏--------------------------
var touchPageYStart = 0;
try{
if($.isFunction(eval(etouch))){
var touch = etouch;
}
}catch(e){
var touch = function (event){
var event = event || window.event;
var eot = event.touches[0];
switch(event.type){
case "touchstart":
touchPageYStart = eot.clientY;
break;
case "touchend":
break;
case "touchmove":
var stTmp = $("body").scrollTop();
$("body").scrollTop(stTmp + (touchPageYStart - eot.clientY));
touchPageYStart = eot.clientY;
event.preventDefault();
break;
}
}
}
document.addEventListener('touchstart',touch, false);
document.addEventListener('touchend',touch, false);
document.addEventListener('touchmove',touch, false);
function onBridgeReady(){
//WeixinJSBridge.call('hideOptionMenu');
}
if (typeof WeixinJSBridge == "undefined"){
if( document.addEventListener ){
document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
}else if (document.attachEvent){
document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);
}
}else{
onBridgeReady();
}