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

其原因是 可能是 canvas 元素的问题 将canvas加入到div元素中就可以解决。 
<html lang="en">
    <head>
    <meta charset="utf-8">


    <style>
    body, canvas, div {
    -moz-user-select: none;
    -webkit-user-select: none;
    -ms-user-select: none;
    -khtml-user-select: none;
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

#Cocos2dGameContainer {
    position: absolute;
    margin: 0;
    overflow: hidden;
    left: 0px;
    top: 0px;
    display: -webkit-box;
    -webkit-box-orient: horizontal;
    -webkit-box-align: center;
    -webkit-box-pack: center;
}
</style>

    

    <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">

        <canvas id="gameCanvas" width="640" height="960"></canvas>
    </div>

                
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值