第一次打开浏览器canvas加载的图片不显示 要刷新一次才显示这是为什么?怎么解决?求助。。
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://www.w3.org/TR/xhtml1/...
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/hongbao.css" rel="stylesheet"/>
<script src="js/jquery-1.7.2.min.js"></script>
<title>无标题文档</title>
</head>
<body onload="window.location.Reload();">
<div id="main_div">
<div class="float" id="div_back">
<div id="div2">
<div id="div_can">
<canvas id="can" width="250px" height="250px">显示表示浏览器不支持canvas</canvas>
</div>
<div id="p1">网鱼网乐宇涛店</div>
<div id="p2">发了一个红包,奖品随机</div>
<div id="p3">恭喜发财,大吉大利!</div>
<div id="none"></div>
<div id="d2"><img id="money" src="image/Money.png"/></div>
<div id="d">
<a><img id="button" src="image/button1.png"/></a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var can = document.getElementById("can");
var ctx = can.getContext("2d");
var pic = new Image();
var a = document.getElementById("money");
var r = 0;
pic.src="image/u=4096216735,3547483452&fm=21&gp=0.jpg";
ctx.drawImage(pic,0,0,250,250);
ctx.globalCompositeOperation="destination-in";
ctx.arc(125,125,125,0,2*Math.PI,true);
ctx.fill();
$("#button").on('click',function(e){
document.getElementById("d").style.display="none";
document.getElementById("d2").style.display="block";
document.getElementById("d2").style.top="144px";
setInterval(function(){
r=r+5;
if(r == 360){
window.location.href="Open.html";
}
var n = r+"deg";
a.style.transform='rotateY('+n+')';
},60);
});
});
</script>
</body>
</html>
突然发现新打开浏览器的时候图片不显示 但是在已经打开的浏览器中新建标签页的话图片却会显示。 求助啊求助。。。 展开
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="css/hongbao.css" rel="stylesheet"/>
<script src="js/jquery-1.7.2.min.js"></script>
<title>无标题文档</title>
</head>
<body onload="window.location.Reload();">
<div id="main_div">
<div class="float" id="div_back">
<div id="div2">
<div id="div_can">
<canvas id="can" width="250px" height="250px">显示表示浏览器不支持canvas</canvas>
</div>
<div id="p1">网鱼网乐宇涛店</div>
<div id="p2">发了一个红包,奖品随机</div>
<div id="p3">恭喜发财,大吉大利!</div>
<div id="none"></div>
<div id="d2"><img id="money" src="image/Money.png"/></div>
<div id="d">
<a><img id="button" src="image/button1.png"/></a>
</div>
</div>
</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
var can = document.getElementById("can");
var ctx = can.getContext("2d");
var pic = new Image();
var a = document.getElementById("money");
var r = 0;
pic.src="image/u=4096216735,3547483452&fm=21&gp=0.jpg";
ctx.drawImage(pic,0,0,250,250);
ctx.globalCompositeOperation="destination-in";
ctx.arc(125,125,125,0,2*Math.PI,true);
ctx.fill();
$("#button").on('click',function(e){
document.getElementById("d").style.display="none";
document.getElementById("d2").style.display="block";
document.getElementById("d2").style.top="144px";
setInterval(function(){
r=r+5;
if(r == 360){
window.location.href="Open.html";
}
var n = r+"deg";
a.style.transform='rotateY('+n+')';
},60);
});
});
</script>
</body>
</html>
突然发现新打开浏览器的时候图片不显示 但是在已经打开的浏览器中新建标签页的话图片却会显示。 求助啊求助。。。 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询