3
我已经创建了一个html5 web应用程序来显示数据,并且我使用了一个叫做Wipetouch的jquery插件来进行模拟滑动手势。当擦除手势被触发时,我所做的只是通过javascript函数重新绘制所有数据。我意识到这不是最佳的解决方案,因为图像是静态的,并且每次滑动时都会加载。任何想法都会很棒。Javascript正在加载图像
编辑
var img01 = new Image();
enter code here
img01.onload = function() {
ctx.drawImage(img01, x, y, img01.width * 2, img01.height * 2);
ctx.fillStyle = "white";
//draw text
ctx.font = "bold 28pt Calibri";
ctx.fillText(monthname[date.getMonth()], x+51, y+135);
ctx.fillText(d[1], x+47, y+37);
}
img01.src = 'images/retail_car.png';
我不使这个明确早些时候表示歉意。我在画布上绘制图像,每当wipetouch插件注册一次滑动时就会触发此代码。我希望将所有内容都保留在画布中,因此提到的CSS修补程序在我的情况下不起作用。
你能告诉我们js函数吗? – 2012-04-04 17:22:05
请显示HTML和JS。我们不能只用你的话来跟踪具体情况。 – jfriend00 2012-04-04 17:22:44