6

I have the following issue:

I open a dialog box with jQuery UI. This dialog box contains a lot of content, which can't be displayed at once.

Is it possible to scroll to a specific element within the dialog box?

1 Answer 1

9

Possible duplicate

Answer from previous question:

var container = $('div'),
scrollTo = $('#row_8');

container.scrollTop(
    scrollTo.offset().top - container.offset().top + container.scrollTop()
);

// Or you can animate the scrolling:
container.animate({
    scrollTop: scrollTo.offset().top - container.offset().top + container.scrollTop()
});​
Sign up to request clarification or add additional context in comments.

3 Comments

Ok I didn't know that this would also work within other contains. Thanks a lot.
No worries. The dialog box is just another div so it will work in that too.
Yes I testet it and it does. Thanks again.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.