I have a standard scrollable content with some block elements.
I want to find out position of the div (relative to content top) and move scroll to that possiton. Is it possible? Maybe with jquery.
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.
Yes, in jQuery it is possible.
You can get the position of any id like this:
$(divId).position().topand use
scrollTopto set where the scrollbar goes.Here’s a fiddle, does that help?