我在Facebook上的应用程序有问题。当我在facebook之外运行应用程序时,它运行完美。当我在facebook高度上运行它时,属性会不断增加。有谁知道问题出在哪里?当我在facebook之外时,它正在工作,但当我在facebook框架内时,高度越来越大
这是我运行游戏时的屏幕截图(注意div元素的高度):
这是30秒后的截图:
以下是用于绘制图像的代码(谜题):
draw_image: function (c) {
var g = this.max_width,
d = this.max_height,
a, f, e = this.ctx;
if (c.width > g || c.height > d) {
var b = Math.min(g / c.width, d / c.height);
a = e.canvas.width = ~~(c.width * b);
f = e.canvas.height = ~~(c.height * b);
e.drawImage(c, 0, 0, c.width, c.height, 0, 0, a, f)
} else {
e.canvas.width = c.width;
e.canvas.height = c.height;
e.drawImage(c, 0, 0)
}
}
这是canvas元素的CSS:
div#canvas-wrap {
width: 100%;
height: 100%;
}
canvas#canvas { z-index: 100; }
canvas#canvas.loading { background: url(../images/loader.gif) no-repeat center; }
canvas#buffer { z-index: 70; }
canvas#image-preview.show {
left: 50%;
opacity: .5;
z-index: 40;
}