公众号在有需要时(如不需要用户分享某个页面),可在网页中通过JavaScript代码隐藏网页右上角按钮。接口调用代码(JavaScript)
# I0 f( |0 w0 I* G$ P* k: g- <script type="text/javascript"> ; W2 ?4 E+ Y/ _* X
- function onBridgeReady(){
, [6 G9 O+ n6 o* { - WeixinJSBridge.call('hideOptionMenu');
& G5 }: m& M& W+ \% u - }. T. L! Y" ^8 U& p" m
- 3 q" W' K' _) ~8 B
- if (typeof WeixinJSBridge == "undefined"){
0 j0 Y& T1 ^+ D/ g4 c0 g J. C - if( document.addEventListener ){
* ]* e( }# m" F& V7 K' K* O$ r - document.addEventListener('WeixinJSBridgeReady', onBridgeReady, false);9 j) F' C, d. R# y- A; `! p' X
- }else if (document.attachEvent){ ~, U/ M# t/ Z* _
- document.attachEvent('WeixinJSBridgeReady', onBridgeReady);
& h2 f2 D; n. O - document.attachEvent('onWeixinJSBridgeReady', onBridgeReady);& M* z5 I( g% o: ]! f. n
- }7 `' ^- F; i- h' U- _ J3 f' _
- }else{
% l1 w% D& a# V( ]5 c - onBridgeReady();* C: K3 Y5 M+ {4 _* J* p7 ^6 H
- }
4 n$ z3 p3 S3 P - </script>
复制代码 - k9 w1 U- H8 w
, b" x1 K5 o2 w" W7 f1 V. w5 C返回说明
/ ]" g6 _7 G G/ D8 F隐藏底部导航栏没有返回值。(需要显示请把hideOptionMenu换成showOptionMenu)
1 |/ a- P' |. I7 }/ F: @; I- Y4 d" s! g i+ R/ Z
9 R; c& w5 }# o/ S |