Hi Vince,
The prototype Element.toggle changes the visibility of an element. I use
scriptaculous for element effects.
You should be able to string a couple of prototype & scriptaculous
statements together to get what you what like so..
:onclick => "Element.toggle(''plus_id'');
Element.toggle(''minus_id'');
Effect.appear(''element_id''),"
That should point in you in one possible direction.
rgds.
matt.
Tickex - the concert, theatre, & sports search engine for tickets
http://www.tickex.com
vince wrote:> I''m currently doing this:
>
> <%= link_to_function h(course.title),
> "Element.toggle(''course#{course.id}'')" %>
>
> Is there a way to:
>
> (a) Extend this so that instead of simply clicking on a title to
> toggle the element the user can click on a plus symbol that shows the
> div which also changes the plus symbol to a minus symbol. Clicking on
> the minus symbol would then hide the div and also change the minus
> symbol back to plus. I''ve seen this on quite a few websites so I
> think you know what I''m talking about :)
>
> (b) Have some effect on toggling the element. I googled around and
> tried this, but it doesn''t seem to work:
>
> <%= link_to_function h(course.title),
> "Element.toggle(''course#{course.id}'',
''blind'')" %>
>
> Any ideas?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---