我有在一个页面中div元素和绑定以下事件鼠标和触摸事件的不同浏览器和
/
/ for ie9, safari, mozilla
this._on(this.element, "mousedown", this.chartMouseDown);
this._on(this.element, "mouseup", this.chartMouseUp);
this._on(this.element, 'mousemove', this.chartMouseMove);
// for chrome
this._on(this.element, 'touchmove', this.chartTouchMove);
this._on(this.element, 'touchstart', this.chartTouchClick);
this._on(this.element, 'touchend', this.chartTouchClick);
if (window.navigator.msPointerEnabled) {
this._on(this.element, 'MSPointerMove', this.chartMouseMove);
this._on(this.element, 'MSPointerDown', this.chartMouseClick);
}
上触摸div和continousous移动设备,在div必须移动根据我的手指在页面上的位置。这在Firefox,铬,Safari浏览器中工作正常,但不是在IE浏览器(拖动鼠标使用鼠标工作,通过触摸它不工作)。
我在所有的鼠标处理程序中都使用了下面的代码:例如。
chartMouseMove: function (e) {
e.stopPropagation();
e.preventDefault();
e.returnValue = false;
e.cancelBubble = true;
}
在使用触摸支持移动DIV,整个页面向上移动,并在IE浏览器下,默认的行为正在发生,我是否错过了IE浏览器的任何东西吗?
请解释如何处理各种浏览器和设备(手机|平板电脑| android)的触摸和鼠标事件。
在此先感谢
我已经使用了,仍然面临的问题$(this.svgObject)的.css( ' - MS-触摸动作', '无'); – user3326265