公众号在有需要时(如不需要用户分享某个页面),可在网页中通过JavaScript代码隐藏网页右上角按钮。接口调用代码(JavaScript)* }; y- e; B$ z. d K
- <script type="text/javascript"> : q2 `% u0 K: Q. X
- function onBridgeReady(){
' y3 w b( N' M4 c7 f2 w' [4 n3 v* U - WeixinJSBridge.call('hideOptionMenu');
5 ]' Y0 e2 i0 ~- f - }0 ~) v) Y+ `+ p/ v7 ]- T/ w
8 y$ U: t; p% | V9 V( |! [6 v- if (typeof WeixinJSBridge == "undefined"){
- n* J, x; d( P" f - if( document.addEventListener ){
& U% Z: \0 w6 M/ m - document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);5 |" X2 `1 M7 E1 v4 N. P
- }else if (document.attachEvent){
. R5 R1 E3 ~- i' L) D( ] - document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
# G" y, t$ y& Q# S+ E5 A - document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);5 }- ~0 e9 a$ V6 D- F, h8 I$ J
- }* q9 p" p, x7 A9 N( y, U, L$ v
- }else{
6 T3 P% A& S& o% ?- y, a& u - onBridgeReady();
3 |* P# y3 S; N- Q4 D4 K - }
) Q% e% l/ B/ e+ e" O$ V! ?# ] - </script>
复制代码
" \- z d7 {2 V
# i4 ?( P" W4 l返回说明
7 H- ~ T2 G+ G# G隐藏底部导航栏没有返回值。(需要显示请把hideOptionMenu换成showOptionMenu); L/ g! [4 b* A
# O/ m4 v2 l& l& C( G# y
) t/ s; j: S K. v" Z5 o |