0

I have a div that has content loaded into it. If the user tries to load different content into it I want the div to scroll to the top of itself first. This cannot be achieved by anchor tags and needs a bit of JQuery.

Any ideas?

Marvellous

2
  • "If the user tries to load different content into it I want the div" -- what does this mean? Commented Sep 15, 2011 at 10:19
  • What do you have, what is the problem, etc.? Add some code example first. Commented Sep 15, 2011 at 10:20

3 Answers 3

3

Just call scrollTop on the element:

$('#scrollable_div').scrollTop(0);
Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I can except your answer in 6 minutes
0

Try to use ScrollTo plugin for jQuery.

Comments

0

jQuery scrollTo will be your best friend for doing something like this

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.