Forum: Ruby on Rails rjs toggle blind effect headache

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
5ef95bf95af5064ff3c2bcafa6a8a212?d=identicon&s=25 Dave M (Guest)
on 2007-03-03 14:15
(Received via mailing list)
I am trying to write a little rjs template that toggles a div.

Aha:

page[:div_id].toggle

I hear you cry, and yes it works, but what I am trying to do is the
equivalent of:

Effect.toggle('div_id', 'blind')

Can anybody tell me have to write this in a rjs template??

Any help great fully received.

David.
A2c85dc5ee81b12e3cc0a6522e8d079d?d=identicon&s=25 Chris Hall (au5lander)
on 2007-03-03 14:50
(Received via mailing list)
according to:

http://api.rubyonrails.org/classes/ActionView/Help...

there is a toggle visual effect of :toggle_blind but it's a
scriptaculous helper, not a prototype helper. so try

page[:div_id].visual_effect(:toggle_blind)

or

page.visual_effect :toggle_blind, 'div_id'

if all else fails

page.call 'Effect.toggle', 'div_id', 'blind'

should do the trick.
5ef95bf95af5064ff3c2bcafa6a8a212?d=identicon&s=25 David Madden (Guest)
on 2007-03-03 14:56
(Received via mailing list)
Many thanks, both of these worked:

> page.visual_effect :toggle_blind, 'div_id'
>
> page.call 'Effect.toggle', 'div_i


David,
This topic is locked and can not be replied to.