公众号在有需要时(如不需要用户分享某个页面),可在网页中通过JavaScript代码隐藏网页右上角按钮。接口调用代码(JavaScript)$ T M! K: X* w: b
- <script type="text/javascript"> 2 r7 }3 ^6 C8 j& A% R* M( I$ {
- function onBridgeReady(){
; d/ c% |# U4 ^# ?. l2 S* d - WeixinJSBridge.call('hideOptionMenu');' Q* c& D. }$ |$ u6 \
- }
) D% \1 u& E4 u, {& ]* v - ! L2 k* R/ v. b" i S
- if (typeof WeixinJSBridge == "undefined"){
1 Z7 W7 L1 K6 K; B - if( document.addEventListener ){; ~% m8 Z% B9 z7 @, }, N- e
- document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);
2 Y; y5 Q3 g; y0 Q' X/ l2 u - }else if (document.attachEvent){/ @7 S ^, G) F; i
- document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
) H' [5 T9 {; s - document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);( {( i: [5 w/ K5 G& S% D. T. m
- }
0 V# A- E( n9 Z- b) N: r6 K - }else{1 \ A- Y9 O$ b$ j( E+ `
- onBridgeReady();
6 y& V# Y5 h1 H n- ~ - }
. k- z" H& M" x) d - </script>
复制代码 4 p! _* T/ w+ F7 m- l6 E, G D, \, |
8 l2 N4 ^$ K K1 B1 Q P
返回说明
- C3 y5 l- z6 ^8 s# Y隐藏底部导航栏没有返回值。(需要显示请把hideOptionMenu换成showOptionMenu)
; x3 K, l0 W5 F
3 w) Z3 B$ _1 k+ i# O
" R$ c8 d+ U, S, t |