handle scrolling for any element in viewer