Showing posts with label scrolltop. Show all posts
Showing posts with label scrolltop. Show all posts

Thursday, February 13, 2014

Retaining Scroll Position With Dialogs

If you set the height of a jQuery UI dialog widget, the content will scroll vertically. This is the expected result — the .ui-dialog-content div sets the overflow CSS property to auto. However, issues take place when you have multiple dialogs, and content that scrolls inside each. Because of the way focusing works, the vertical scroll bar moves back to the top, whenever the dialog loses focus. Ideally, the user would expect the scroll bar to retain it's position, no matter which dialog has the focus.