Added support for vertical scrolling and detection of vertical vs horizontal scrolling.