Encapsulate mouse dragging operations on DOM elements