1、最近在用h5的canvas画动画,发现图像特别模糊。后来终于找到罪魁祸首是<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />这个代码,因为这行代码进行了伸缩

2、模糊图像的效果:

3、将压缩去掉后的效果

可以将代码改成

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="user-scalable=no" />
<title>赛事详细页</title>
<script src="js/rem.js" type="text/javascript" charset="utf-8"></script>
<link rel="stylesheet" type="text/css" href="css/m_reset.css" />
<link rel="stylesheet" type="text/css" href="css/gameListsNew.css" />
<link href="css/mask.css" rel="stylesheet" />
</head>
<body>
<div class="tipMask">
<div class="tipBox">
<img src="img/faileTip.png" class="tipsImg" />
<div class="fileBtn">
<img src="img/fileBtn.png" />
<span class="tryAgain">再试一次</span>
</div>
</div>
</div>
<div>
<img src="img/whiteBack.png" class="titleImg" /> <div class="bgEvent" id="contentbody">
<div id="eventDetail" v-cloak>
<!--标题-->
<div class="detailevent">
<div class="titlevs">
<img class="teamFlagLogo" onerror="nofind(this);" :src="'img/teamlogonew/'+eventDetail.HomeTeamID+'.png'" />
<div class="countryName">
{{eventDetail.HomeTeamName}}
</div>
</div>
<div class="titlevs" style="padding-top:0.3rem ;">
<div>
<!--未开赛-->
<!--<p class="theWorldCup">世界杯</p>-->
<p class="theGameNowDataTime">{{eventDetail.TimeFormat }}</p>
<p class="gameBeginTime">{{getScoreOrVs(eventDetail.HomeTeamScore,eventDetail.AwayTeamScore)}}</p>
</div>
<!--开赛时长-->
<!--<div>
<p>:</p>
</div>-->
</div>
<div class="titlevs">
<img class="teamFlagLogo" onerror="nofind(this);"
:src="'img/teamlogonew/'+eventDetail.AwayTeamID+'.png'" />
<div class="countryName">
{{eventDetail.AwayTeamName}}
</div>
</div>
</div> <div id="ordersuccess" class="ordersuccess">
<div style="text-align:right;padding-top:0.2rem;padding-left:0.2rem;">
<img src="img/ordersuccess/close.png" style="width:0.45rem;height:0.45rem;" id="closesuccess" onclick="closesuccess();" />
</div>
<div class="teamname">
<div class="teamnameitem"><p class="teamnameitemtop">{{eventDetail.HomeTeamName}}</p><br /><p class="teamnameitembottom">HOME</p></div>
<div class="teamnameitem "><p class="teamnameitemmiddle">VS</p></div>
<div class="teamnameitem"><p class="teamnameitemtop">{{eventDetail.AwayTeamName}}</p><br /><p class="teamnameitembottom">AWAY</p></div>
</div>
<div class="teamdetail">
<div class="teamdate"><span>{{eventDetail.CompetitionName}}</span><span>/</span><span>{{eventDetail.DateFormat}}</span></div>
<div class="teamplaysselection">
<table style="width:100%;text-align:left;height:100%;">
<tr>
<td class="teamplaysselectiontop" style="width:50%;">玩法</td>
<td class="teamplaysselectiontop" style="width:50%;">选项</td>
</tr>
<tr>
<td class="teamplaysselectionbottom" style="width:50%;" id="rulename">Match Odds</td>
<td class="teamplaysselectionbottom" style="width:50%;" id="selectionname">Home</td>
</tr>
</table>
</div>
<div class="teamwinmoney">
<table style="width:90%;text-align:left;height:100%;">
<tr>
<td class="teamwinmoneytop" style="width:50%;">
本金
</td>
<td class="teamwinmoneytop" style="width:50%;">
赔率
</td>
<td class="teamwinmoneytop" style="width:50%;">
预赢
</td>
</tr>
<tr>
<td class="teamwinmoneybottom" style="width:50%;" id="betmoneysuc"></td>
<td class="teamwinmoneybottom" style="width:50%;" id="betodds">12.54</td>
<td class="teamwinmoneybottom" style="width:50%;" id="betwin"></td>
</tr>
</table>
</div>
</div>
</div> </div> <div>
<div class="square" id="square">
<canvas id="courtCaseNew" width="" height=""></canvas>
</div>
<img src="img/balllittle.png" style="width:20px;height:20px;display:none;" id="imgballNew" />
</div> <div class="middlechat"> <div class="middleitem" id="jcc">
<p class="tabActive">竞猜场</p>
</div> <div class="middleitem" id="jcjl">
<p class="tabCommon">竞猜记录</p>
</div> <div class="middleitem" id="sssj">
<p class="tabCommon">赛事事件</p>
</div>
<div class="middleitem" id="jstj">
<p class="tabCommon">技术统计</p>
</div>
</div>
<div class="downChangrTab quizGames" style="display: block;">
<div id="ruleTypeItems" v-cloak>
<!--胜平负-->
<div class="diffPlaysTetx" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==100">
<span class="speciesName">赛果</span>
<span class="rotary" v-if="item.State!=1">(已封盘)</span>
<span class="speciesExp">猜90分钟(含补时)两队的比赛结果</span>
</div>
<div v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==100" id="result" name="selectionItems" class="result">
<div v-bind:class="[(select.BackOdds<1.01 || item.State!=1) ? 'resutitemGray commonBorderGray':'resutitem commonBorder']" v-for="(select,index) in item.Selection"
v-on:click="select.BackOdds>=1.01 &&clickFun($event,item.State,select.BackOdds,item.MarketId,select.SelectionId,'赛果',select.SelectionName);" name="itemSelection">
<p class="winEquLose" v-bind:name="'item'+item.MarketId">{{select.SelectionName}}</p>
<p class="winEquLoseOdds " v-bind:name="'item'+item.MarketId">
<span v-bind:id="item.MarketId+select.SelectionId" v-bind:maxlimit="select.MaxStakeLimit">{{select.BackOdds}}</span>
<img src="img/upIng.png" style="width:0.2rem;display:none;" v-bind:id="'redOne'+item.MarketId+select.SelectionId" />
<img src="img/downIng.png" style="width:0.2rem;display:none;" v-bind:id="'greenOne'+item.MarketId+select.SelectionId" />
</p>
</div>
</div> <!--单双-->
<div class="diffPlaysTetx" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==130">
<span class="speciesName">单双</span>
<span class="rotary" v-if="item.State!=1">(已封盘)</span>
<span class="speciesExp">猜90分钟(含补时)比赛总进球的单双</span>
</div>
<div id="oddeven" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==130" name="selectionItems" class="oddeven">
<div v-bind:class="[(select.BackOdds<1.01 || item.State!=1) ? 'oddevenitemGray commonBorderGray':'oddevenitem commonBorder']" v-for="(select,index) in item.Selection" v-on:click="select.BackOdds>=1.01 &&clickFun($event,item.State,select.BackOdds,item.MarketId,select.SelectionId,'单双',select.SelectionName)" name="itemSelection">
<p class="winEquLose" v-bind:name="'item'+item.MarketId" v-bind:id="'selectionname'+item.MarketId+select.SelectionId">{{select.SelectionName}}</p>
<p class="winEquLoseOdds" v-bind:name="'item'+item.MarketId">
<span v-bind:id="item.MarketId+select.SelectionId" v-bind:maxlimit="select.MaxStakeLimit">{{select.BackOdds}}</span>
<img src="img/upIng.png" style="width:0.2rem;display:none;" v-bind:id="'redOne'+item.MarketId+select.SelectionId" />
<img src="img/downIng.png" style="width:0.2rem;display:none;" v-bind:id="'greenOne'+item.MarketId+select.SelectionId" />
</p>
</div>
</div> <!--总进球-->
<div class="diffPlaysTetx" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==410">
<span class="speciesName">总进球 </span>
<span class="rotary" v-if="item.State!=1">(已封盘)</span>
<span class="speciesExp">猜90分钟(含补时)比赛总进球的数 </span>
</div>
<div id="totalGoals" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==410" name="selectionItems" class="totalGoals"> <div v-bind:class="[(select.BackOdds<1.01 || item.State!=1) ? 'totalGoalitemGray commonBorderGray':'totalGoalitem commonBorder']" v-for="(select,index) in item.Selection" v-on:click="select.BackOdds>=1.01 &&clickFun($event,item.State,select.BackOdds,item.MarketId,select.SelectionId,'总进球',select.SelectionName)" name="itemSelection">
<p class="winEquLose" v-bind:name="'item'+item.MarketId" v-bind:id="'selectionname'+item.MarketId+select.SelectionId">{{select.SelectionName}}</p>
<p class="winEquLoseOdds" v-bind:name="'item'+item.MarketId">
<span v-bind:id="item.MarketId+select.SelectionId" v-bind:maxlimit="select.MaxStakeLimit">{{select.BackOdds}}</span>
<img src="img/upIng.png" style="width:0.2rem;display:none;" v-bind:id="'redOne'+item.MarketId+select.SelectionId" />
<img src="img/downIng.png" style="width:0.2rem;display:none;" v-bind:id="'greenOne'+item.MarketId+select.SelectionId" />
</p>
</div>
</div> <!--全场比分-->
<div class="diffPlaysTetx" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==140">
<span class="speciesName">全场比分</span>
<span class="rotary" v-if="item.State!=1">(已封盘)</span>
<span class="speciesExp">猜90分钟(含补时)全场比分</span>
</div>
<div id="correctScoreHome" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==140" name="selectionItems" class="correctScoreHomeAway"> <div v-bind:class="[(select.BackOdds<1.01 || item.State!=1) ? 'correctScoreitemGray commonBorderGray':'correctScoreitem commonBorder']" v-for="(select,index) in item.Selection" v-on:click="select.BackOdds>=1.01 &&clickFun($event,item.State,select.BackOdds,item.MarketId,select.SelectionId,'全场比分',select.SelectionName)" name="itemSelection">
<p class="winEquLose" v-bind:name="'item'+item.MarketId" v-bind:id="'selectionname'+item.MarketId+select.SelectionId">{{select.SelectionName}}</p>
<p class="winEquLoseOdds" v-bind:name="'item'+item.MarketId">
<span v-bind:id="item.MarketId+select.SelectionId" v-bind:maxlimit="select.MaxStakeLimit">{{select.BackOdds}}</span>
<img src="img/upIng.png" style="width:0.2rem;display:none;" v-bind:id="'redOne'+item.MarketId+select.SelectionId" />
<img src="img/downIng.png" style="width:0.2rem;display:none;" v-bind:id="'greenOne'+item.MarketId+select.SelectionId" />
</p>
</div> </div>
<div class="downImg" onclick="clickImg()">
<img src="img/toDown.png" />
</div>
<!--下一进球-->
<div class="diffPlaysTetx" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==350">
<span class="speciesName">下一进球</span>
<span class="rotary" v-if="item.State!=1">(已封盘)</span>
<span class="speciesExp">猜90分钟(含补时)下一进球的球队</span>
</div>
<div id="nextgoal" v-for="(item,index) in eventDetail.Market" v-if="item.RuleType==350" name="selectionItems" class="result"> <div v-bind:class="[(select.BackOdds<1.01 || item.State!=1) ? 'resutitemGray commonBorderGray':'resutitem commonBorder']" v-for="(select,index) in item.Selection" v-on:click="select.BackOdds>=1.01 &&clickFun($event,item.State,select.BackOdds,item.MarketId,select.SelectionId,'下一进球',select.SelectionName)" name="itemSelection">
<p class="winEquLose" v-bind:name="'item'+item.MarketId" v-bind:id="'selectionname'+item.MarketId+select.SelectionId">{{select.SelectionName}}</p>
<p class="winEquLoseOdds" v-bind:name="'item'+item.MarketId">
<span v-bind:id="item.MarketId+select.SelectionId" v-bind:maxlimit="select.MaxStakeLimit">{{select.BackOdds}}</span>
<img src="img/upIng.png" style="width:0.2rem;display:none;" v-bind:id="'redOne'+item.MarketId+select.SelectionId" />
<img src="img/downIng.png" style="width:0.2rem;display:none;" v-bind:id="'greenOne'+item.MarketId+select.SelectionId" />
</p>
</div>
<div class="" style="width: 100%;height:0.45rem;"></div>
</div>
<div class="perchDiv" style="width: 100%;height:3rem;"></div>
</div>
</div>
<!--竞猜记录-->
<div class="downChangrTab guessRecord">
<div class="hide-body" id="dialogorders">
<div class="tableNameGuess">
<li>玩法</li>
<li>选项</li>
<li>赔率</li>
<li>本金</li>
<li>结果</li>
</div>
<ul style="background:#FFFFFF;height:4.79rem;overflow: scroll;">
<div class="guessedLists" id="contentOrders" v-for="(item,index) in orders">
<li>
{{item.MarketName}}
</li>
<li>
{{item.SelectionName}}
</li>
<li>
{{item.FillPrice}}
</li>
<li>
{{item.FillAmount}}
</li>
<li>
<p v-if="item.Status == '0'"> 待确认</p>
<p v-else-if="item.Status == '1'">订单正常</p>
<p v-else-if="item.Status == '2'">{{item.NetReturn}}</p>
<p v-else-if="item.Status == '3'">订单已被取消</p>
<p v-else-if="item.Status == '4'">订单无效</p>
<p v-else="item.Status == '5'">订单被拒绝,投注延迟期间发生重要事件等原因</p>
</li>
</div>
</ul>
</div>
</div>
<!--赛事事件-->
<div class="downChangrTab" style="display: none;" v-if="">
<div class="login-body" id="contentCases">
<table class="whatHappen" v-if="cases.length >0">
<tr>
<td></td>
<td class="happenedMiddle">
<div class="happenedMiddle_top" style="margin-top: 0.4rem;"></div>
</td>
<td></td>
</tr>
</table>
<table class="whatHappen" style="" v-for="(item,index) in cases" border="" cellspacing="" cellpadding="">
<tr>
<td></td>
<td class="happenedMiddle">
<div class="happenedMiddle_line"></div>
</td>
<td></td>
</tr>
<tr v-if="item.CaseDescription.indexOf('主')>-1">
<td class="eventsHappendLeft_things">
<div class="eventsText">
<p class="eventsTextLeft_time">{{item.CaseMinutes}}'</p>
<p class="eventsTextLeft_Country">{{item.CaseDescription}}</p>
</div>
</td>
<td class="happenedMiddle">
<div class="eventsHappend_img">
<img :src="GetMatchEventImg(item.CaseDescription)" />
</div>
</td>
<td></td>
</tr>
<tr v-if="item.CaseDescription.indexOf('客')>-1">
<td></td>
<td class="happenedMiddle">
<div class="eventsHappend_img">
<img :src="GetMatchEventImg(item.CaseDescription)" />
</div>
</td>
<td class="eventsHappendRight_things">
<div class="eventsText">
<p class="eventsTextRight_Country">{{item.CaseDescription}}</p>
<p class="eventsTextRight_time">{{item.CaseMinutes}}'</p>
</div>
</td>
</tr>
<tr v-if="item.CaseDescription.indexOf('主')<0 && item.CaseDescription.indexOf('主')<0">
<td></td>
<td>
<a class="ti tlefoc">{{item.CaseMinutes}}'</a>
<a class="titlefoc">{{item.DesChina}}</a>
</td>
<td></td>
</tr>
</table>
<table class="whatHappen" v-if="cases.length >0">
<tr>
<td></td>
<td class="happenedMiddle">
<div class="happenedMiddle_line"></div>
<div class="happenedMiddle_top"></div>
</td>
<td></td>
</tr>
</table>
<!--<div style="width: 100%; height: 2.7rem;"></div>-->
</div> </div>
<!--技术统计-->
<div class="downChangrTab" style="display: none;">
<div class="skillInfoGaryBg" id="stutsskillsData"> <div class="skillInfo" v-for="(item, index) in skillsData">
<li class="shotsOnTargets">
<div class="shotsOnTargets_left">
<p class="skillsTextFonts">{{item.AwayTeamValue}}</p>
<div class="sotl_bg">
<div class="sotl_bgProgress"></div>
</div>
</div> <div class="shotsOnTargets_middle"> <img :src="GetMatchStatsImage(item.StatsType)" />
<p class="shills_name">{{item.StatsType}}</p>
</div> <div class="shotsOnTargets_right">
<p class="skillsTextFonts">{{item.HomeTeamValue}}</p>
<div class="sotl_bg">
<div class="sotl_bgProgress"></div>
</div>
</div>
</li> </div>
</div>
</div> </div>
<!--底部下单-->
<div class="buttomOrder">
<!--金额输入-->
<!--竞猜金额-->
<div class="aboutMoney">
<input type="text" name="" id="betmoney" class="gussMoney" value="竞猜金额" placeholder="" readonly="readonly" v-model="gussMoney" />
<img src="img/clearBetMoney.png" class="clearGussMoney" id="clearGussMoney" />
<!--余额-->
<span class="balanceMoney" id="minemoney">我的余额:</span>
<!--下注金额-->
<div class="diffGussMoney" style="text-align:center;">
<ul>
<li name="bettingmoney" class="difGuMonCom" val="">+</li>
<li name="bettingmoney" class="difGuMonCom" val="">+</li>
<li name="bettingmoney" class="difGuMonCom" val="">+</li>
<li class="difGuMonCom" id="allin" style="line-height: 0.5rem;">
<p style="height: 0.3rem;">All <span style="margin-left: 0.05rem;">in</span></p>
<p id="allinvalue" style="height: 0.3rem;"></p>
</li>
</ul>
</div>
<!--确定-->
<p class="subSure subSureRed" style="text-align:center;" onclick="CreateOrder();" id="subSure">
确定
</p>
</div>
</div>
<!--下单成功后遮罩层--> <div id="overlay" class="overlay"></div>
</div>
<div>
<img src="img/goal/goalball.png" />
<img src="img/goal/goal.png" />
<img src="img/goal/fireworks.png" />
</div>
<script src="js/jquery-1.10.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/vue.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/common.js?ver=012902" type="text/javascript" charset="utf-8"></script>
<script src="js/jquery.cookie.min.js"></script>
<script src="js/mask.js?ver=012901"></script>
<script type="text/javascript" src="js/eventDetailsNew.js?ver=012908"></script>
<script src="../js/animation.js"></script> </body> </html>

H5 Canvas图像模糊解决办法的更多相关文章

  1. [转载]常见的移动端H5页面开发遇到的坑和解决办法

    转过来,平时看看.虽然还有很多问题至今无解.比如:华为麒麟950的P8和meta打开我们的应用首页经常偶发白屏.!! 1.安卓浏览器看背景图片,有些设备会模糊. 用同等比例的图片在PC机上很清楚,但是 ...

  2. 常见的移动端H5页面开发遇到的坑和解决办法

    转过来,平时看看.虽然还有很多问题至今无解.比如:华为麒麟950的P8和meta打开我们的应用首页经常偶发白屏.!! 1.安卓浏览器看背景图片,有些设备会模糊. 用同等比例的图片在PC机上很清楚,但是 ...

  3. X5内核浏览器video自动全屏解决办法-canvas

    最近在做手机端上面播放视频的项目,但是在安卓上面,video的播放是脱离页面,置于最顶层的,所以带来了很多问题,为了解决这个问题,查看了多方资料,写了下面简单的demo,方便以后使用. 下面就是运用c ...

  4. iphone H5 input type="search" 不显示搜索 解决办法

    H5 input type="search" 不显示搜索 解决办法 H5 input type="search" 不显示搜索 解决方法 在IOS(ipad iP ...

  5. h5 + nginx + php 视频上传之突破文件大小受限的解决办法

    一.环境: CentOS 6.8 nginx 1.8.0 php 7.0.10 二.背景 基于 nginx + php 的 h5 项目,上传视频的时候,如果视频太大,会上传失败. 三.正文 一份视频传 ...

  6. 关于canvas画布使用fillRect()时高度出现双倍效果解决办法

    当设置canvas的宽度和高度时,只有内嵌css有效,外部css会出现拉伸的情况,例如: <!DOCTYPE html> <html lang="en"> ...

  7. 口碑订单,ERP本地加/退菜无法回流至手机端的解决办法-订单金额不统一erp本地加菜H5没有

    关于 口碑订单,ERP本地加/退菜无法回流至手机端的解决办法-订单金额不统一erp本地加菜H5没有 1. 2. 3. PS:是正餐后付的务必要选择口碑后付 完成以上设置即可

  8. 微信内置浏览器浏览H5页面弹出的键盘遮盖文本框的解决办法(转)

    最近在做微信公众号的内嵌页面,发现点击输入框时键盘盖住文本框,找到一段代码解决了这个问题. iOS和android手机都已亲测,需要的可以直接拷贝到代码中使用. js代码如下: $(function ...

  9. H5开发中遇到的问题及解决办法

    记不得什么时候进行H5开发的学习了,只知道是从2016年8月1日开始修复Bug,计划每天把学到的东西以及遇到问题时候的解决方案都记录下来,希望自己能够坚持下去,每天积累一点,希望有所进步吧. 1.Th ...

随机推荐

  1. CSS基础知识(display和visibility、overflow、文档流)

    9.显示与隐藏 u  display属性: (1)none:隐藏元素,不会再占有页面的任何空间,即不会影响布局. (2)inline:默认值.将元素[显示]为内联元素     (与HTML元素本身无关 ...

  2. mybatis foreach批量插入数据:Oracle与MySQL区别

    mybatis foreach批量插入数据:Oracle与MySQL不同点: 主要不同点在于foreach标签内separator属性的设置问题: separator设置为","分 ...

  3. XML(一)XML大揭秘

    前言 每天都要学习很多新的知识,比你厉害的程序员比你还努力,那你混的下这口饭吗?所以不抱怨,坚持!接下来给大家分享的是xml.可能很多做开发的都遇到过xml, 比如maven,各种框架的配置文件都有, ...

  4. CTF---Web入门第九题 FALSE

    FALSE分值:10 来源: iFurySt 难度:易 参与人数:4567人 Get Flag:2144人 答题人数:2157人 解题通过率:99% PHP代码审计 hint:sha1函数你有认真了解 ...

  5. 【Java学习笔记之十四】Java中this用法小节

    用类名定义一个变量的时候,定义的只是一个引用,外面可以通过这个引用来访问这个类里面的属性和方法. 那们类里面是够也应该有一个引用来访问自己的属性和方法纳? 呵呵,JAVA提供了一个很好的东西,就是 t ...

  6. C/C++之循环结构

    C语言中提供四种循环,即goto循环.while循环.do…while循环和for循环.四种循环可以用来处理同一问题,一般情况下它们可以互相代替换,但一般不提倡用goto循环,因为强制改变程序的顺序经 ...

  7. Oracle:对表的CREATE、ALTER、INSERT、RENAME、DELETE操作练习以及主外键约束

    -创建一个student表,设定表的主键为学号CREATE TABLE student( sno VARCHAR2(10) PRIMARY KEY, --列级约束 sno VARCHAR2(20) C ...

  8. 两种方法上传本地文件到github

    https://www.jianshu.com/p/c70ca3a02087 自从使用github以来,一直都是在github网站在线上传文件到仓库中,但是有时因为网络或者电脑的原因上传失败.最重要的 ...

  9. 各大型邮箱smtp服务器及端口收集

    >新浪邮箱smtp服务器 外发服务器:smtp.vip.sina.com 收件服务器:pop3.vip.sina.com 新浪免费邮件 外发服务器:smtp.sina.com.cn 收件服务器: ...

  10. client和nginx简易交互过程

    # client和nginx简易交互过程- step1:client发起http请求- step2:dns服务器解析域名得到主机ip- step3:默认端口为80,通过ip+port建立tcp/ip链 ...