关闭页面右上角分享:
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();
}
关闭当前页面:
WeixinJSBridge.invoke('closeWindow',{},function(res){
//alert(res.err_msg);
});
直接在需要的页面添加代码,代码只在微信中有效果!! 取消分享无需事件引导,但关闭需要事件引导,click等!