I have a div with height 40px; I’d like to do a scrollDown with jQuery from this height to 600px.
How can I do it?
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.
You’re looking for
animaterather thanscrollDown(orslideDown, which I suspect is what you meant). E.g.:Live example
Update: In a comment on another answer you said:
If you have elements aligned with the div in a way that they don’t get moved naturally when the div gets taller (e.g., you’ve used
position: absoluteor similar), you can animate theirtop(orbottom) property at the same time. I’d look at whether it was possible to relate them to the div in a different way, but if you can’t, that would be pretty much your only option. It looks something like this:Live example