I want to create my own implementation of a div with scroll, without using overflow: scroll;
But I can’t seem to figure out how to get the content offset of a div, does anyone know?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m not entirely sure I understand what you mean by “content offset”, but one way to implement scrolling-like behavior would be this:
Now you could scroll
#bwithin#aby changing the#b‘stopproperty. Scrolling it to bottom would mean settingtopto-100px, and0to reset.Implementing an actual scroll-bar would be up to you, though. As well as things like mouse-wheel support.