以下是注册其他事件的代码,在此之外,我想对mouseover添加 Touch events中对应的事件。
addEvents: function() { var mouseDownHandler = this.mouseDownHandler, mouseMoveHandler = this.mouseMoveHandler, mouseUpHandler = this.mouseUpHandler, _events; // Mouse events _events = [ [container, 'mousedown', mouseDownHandler], [container, 'mousemove', mouseMoveHandler], [doc, 'mouseup', mouseUpHandler] ]; // Touch events if (hasTouch) { _events.push( [container, 'touchstart', mouseDownHandler], [container, 'touchmove', mouseMoveHandler], [doc, 'touchend', mouseUpHandler] ); } // Add them all each(_events, function(args) { addEvent.apply(null, args); }); this._events = _events; // Data events if (this.series && this.series[0]) { addEvent(xAxis, 'foundExtremes', function() { scroller.modifyNavigatorAxisExtremes(); }); } addEvent(body, 'redraw', function() { if (xAxis) { scroller.render(xAxis.min, xAxis.max); } }); }
移动设备的那个事件对应的web端的mouseover事件?
上述添加事件代码的主要思路正确吗
touchStart touchMove touchEnd 鼠标可以悬浮 移动端怎么悬浮
移动端没有mouseover事件 这个是针对鼠标的.
在移动端通常是用touchMove结合position来触发事件.
比如实现鼠标/触摸划过 头像 显示弹出层
在移动端,touchMove中判断是否在所在头像的xy区域.然后触发弹出.