# Visual Effect: insert new stuff, then slide open

**URL:** <https://www.ruby-forum.com/t/visual-effect-insert-new-stuff-then-slide-open/189683>\
**Category:** Rails\
**Created:** [June 5, 2010, 2:19am UTC](https://www.ruby-forum.com/t/visual-effect-insert-new-stuff-then-slide-open/189683 "2010-06-05T02:19:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [June 5, 2010, 2:19am UTC](https://www.ruby-forum.com/t/visual-effect-insert-new-stuff-then-slide-open/189683/1 "2010-06-05T02:19:57Z")

</div>

Hi guys: Thanks for your help so far - think I’ve progressed pretty far  
down the Rails front but I think I’m getting stuck, maybe you can help  
me out:

I’ve got a twitter like app where I’m trying to display new tweets as  
they come in. This is what I’m doing right now:

render :update do |page|  
page.insert\_html :top, ‘tweebs-box’, :partial =\> ‘livetweebs’  
end

…which, of course, takes the new content and inserts it before the  
current set on the screen. What i’d like to do is to have it slide down  
elegantly upon the insert, instead of just snap down. I’ve been thinking  
of an easy way to do this but this is the only way I can think of: maybe  
there is an easier way?

1. display the page the first time with a div for the current stuff and  
a hidden div above it for the new stuff to come
2. load the content into the hidden div
3. slide down the new div, thus pushing the current div down
4. insert a new div above this div for the next set to be inserted into

Is there an easier way?

Thanks…Chris

---

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [June 7, 2010, 8:13pm UTC](https://www.ruby-forum.com/t/visual-effect-insert-new-stuff-then-slide-open/189683/2 "2010-06-07T20:13:49Z")

</div>

anyone?

Chris K. wrote:

> Hi guys: Thanks for your help so far - think I’ve progressed pretty far  
> down the Rails front but I think I’m getting stuck, maybe you can help  
> me out:
> 
> I’ve got a twitter like app where I’m trying to display new tweets as  
> they come in. This is what I’m doing right now:
> 
> Is there an easier way?
> 
> Thanks…Chris

---

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [June 9, 2010, 3:11am UTC](https://www.ruby-forum.com/t/visual-effect-insert-new-stuff-then-slide-open/189683/3 "2010-06-09T03:11:01Z")

</div>

Piyush C. wrote:

> try this, if it helps  
> [http://wiki.github.com/madrobby/scriptaculous/combination-effects-demo](http://wiki.github.com/madrobby/scriptaculous/combination-effects-demo)

Hi Piyush: I tried that. I can’t get it to move down smoothly…

---

<div class="post-metadata">

**Author:** ![kampers](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/54ee81/32.png) [@kampers](https://www.ruby-forum.com/u/kampers)\
**Post date:** [June 7, 2010, 8:50pm UTC](https://www.ruby-forum.com/t/visual-effect-insert-new-stuff-then-slide-open/189683/4 "2010-06-07T20:50:58Z")

</div>

try this, if it helps  
[http://wiki.github.com/madrobby/scriptaculous/combination-effects-demo](http://wiki.github.com/madrobby/scriptaculous/combination-effects-demo)
