Cocos2d-js h5游戏在 微信中打开时,点击屏幕后 微信上方title标题消失。

前端之家收集整理的这篇文章主要介绍了Cocos2d-js h5游戏在 微信中打开时,点击屏幕后 微信上方title标题消失。前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
  1. 其原因是 可能是 canvas 元素的问题 canvas加入到div元素中就可以解决 
    <html lang="en">
  2.     <head>
  3.     <Meta charset="utf-8">
  4.     <style>
  5.     body,canvas,div {
  6.     -moz-user-select: none;
  7.     -webkit-user-select: none;
  8.     -ms-user-select: none;
  9.     -khtml-user-select: none;
  10.     -webkit-tap-highlight-color: rgba(0,0,0);
  11. }
  12. #Cocos2dGameContainer {
  13.     position: absolute;
  14.     margin: 0;
  15.     overflow: hidden;
  16.     left: 0px;
  17.     top: 0px;
  18.     display: -webkit-Box;
  19.     -webkit-Box-orient: horizontal;
  20.     -webkit-Box-align: center;
  21.     -webkit-Box-pack: center;
  22. }
  23. </style>
  24.     
  25.     <div id = "Cocos2dGameContainer" style="margin: auto;width: 100%;height: 100%;" class="egret-player" data-entry-class="Main" data-orientation="auto" data-scale-mode="showAll" data-frame-rate="60" data-content-width="640"  data-content-height="960" data-show-paint-rect="false" data-multi-fingered="2" data-show-fps="false" data-show-log="false"  data-show-fps-style="x:0,y:0,size:12,textColor:0xffffff,bgAlpha:0.9">
  26.         <canvas id="gameCanvas" width="640" height="960"></canvas>
  27.     </div>

猜你在找的Cocos2d-x相关文章