1

I have a child element styled with overflow-y: auto that contains a list of other objects. At certain times I need to scroll this list to a particular position, and I have been using item.scrollIntoView() which works almost perfectly.

The problem is that scrollIntoView() scrolls both the list to the correct position, but also forces the list itself to scroll into view. Is it possible to scroll just the list itself without scrolling the window? if jQuery is the only simple way, that is also acceptable.

2
  • jQuery is a library. Not magical. Just slow. And, yes, there's another way. Commented Feb 2, 2014 at 3:37
  • I have done this changing the margin of the child element. Like... margin top to -100px. Would something like this work for you situation? Commented Feb 2, 2014 at 3:50

1 Answer 1

1

I wasn't aware that you could simply manipulate the scrollTop property of the container.

Sign up to request clarification or add additional context in comments.

Comments

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.