Div resize horizontally like in twitter
I want to add functionality like in twitter when scroll down div elongates开发者_StackOverflow中文版 horizontally when click more button. How can i do so?
If you're referring to the tweet stream on twitter.com then it's a bit more complex than elongating a <div>
. Behind the scenes what's happening is javascript running on the page make an AJAX call for more tweets. That data is then rendered to HTML and appended to the container <div>
. In addition the "elongation" effect is likely an animation that simply alters the height of the newly appended content.
A great place to start is with jQuery and the Getting Started with jQuery tutorial.
Also worth checking out are the doc pages for:
- $.ajax
- $.append
- $.slideDown
精彩评论