我正在开发一个基于浏览器的应用程序,目前我正在为ipad safari浏览器开发和设计样式.
我在ipad上寻找两件事:如何禁用不需要它的页面的垂直滚动?如何禁用弹性反弹效果?
这是我正在尝试做的源代码:
使用Javascript:
window.addEventListener('load', function () {
// get the canvas element and its context
var canvas = document.getElementById('sketchpad');
var context = canvas.getContext('2d');
// create a drawer which tracks touch movements
var drawer = {
isDrawing: false,
touchstart: function (coors) {
context.beginPath();
context.moveTo(coors.x, coors.y);
this.isDrawing = true;
},
touchmove: function (coors) {
if (this.isDrawing) {
context.lineTo(coors.x, coors.y);
context.stroke();
}
},
touchend: function (coors) {
if (this.isDrawing) {
this.touchmove(coors);
this.isDrawing = false;
}
}
};
// create a function to pass …Run Code Online (Sandbox Code Playgroud)