fix mouse dragging to be cross-browser compatible