Set the scrolling direction to horizontal or vertical