微信下拉露底這個操作在有些項目上不合適伍派,所以整理了一下解決方法
//觸屏--------------------------
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();
}