문제

I have the following code:

// Drag Event
var _isMoving = false;
$("body").on("mousedown", ".k-event", function () {
    _isMoving = true;
});

// This is here because otherwise the mouse will try and select the grid and looks really ugly
$("body").mousemove(function (e) {
    if (_isMoving)
        e.preventDefault();
});

$("body").mouseup(function () {
    _isMoving = false;
});

On Chrome, this works great.

However, on Firefox, when I try and move the mouse with the mouse button depressed, it still wants to highlight the table cells (as if I were trying to copy/paste something). How can I tell Firefox not to try and highlight anything?

도움이 되었습니까?

해결책

For Firefox you should prevent the event on the mousedown event as well:

$("body").on("mousedown", ".k-event", function (e) { 
  e.preventDefault(); 
  _isMoving = true; 
} 
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top