开发者

Simple blind down effect in rails view

I'm trying to find the simplest way to do a simple blind down effect in my rails app. I have a list of links. Each link is an instance of a "book" object. The link text is the name attribute of the book. I want to make it so that when a user clicks on one of the book names a blind down effect will trigger and show the text from the description attribute of the book object. Then if the user clicks the link again there should be a blind up effect hiding开发者_如何学运维 the description text. Thanks.


I am not sure what you mean by a rails view however you could use the script.aculo.us framework with Blind Up: http://madrobby.github.com/scriptaculous/effect-blindup/ Blind Down: http://madrobby.github.com/scriptaculous/effect-blinddown/

These effects do not work very well with tables. If your rails view uses tables then you could try wrapping the content in a div and calling Effect.BlindUp('id_of_element', { duration: 3.0 }); on the div instead of a tr.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜