Extended the event handling of the $ object.
Added functionality to drag the viewport.