To make it work with IE browsers, you must monitor "document" for the mouseup event. This is because if you "drag" outside scrollPane and then release the mouse, scrollPane will not see the mouseup event. Damned IE!!!
The code I use for such situations, assuming scrollPane is not dynamically generated, is thus...
- var scrollPane = $("#scrollPane");
- $scrollPane.on("mousedown", function(){
- $scrollPane.on("mousemove", scrollOnMove);
- $(document).one("mouseup", function(){ //bind to document to work with IE
- $scrollPane.off("mousemove", scrollOnMove);
- });
- });
Note that I am adding the eventHandler functions' name within .off() purely because I don't know your code. You may have other mousemove handlers attached but, by specifying the eventHandler function, .off() will only move the one specifically relating to the code in question. Remove that parameter from .off() if you wish.
Regards,
Alan