ok so i just found this page:
http://www.prototypejs.org/api/element/toggle

but i am still confused:
1) do i need scriptaculous to get toggle functionality or do i get by
just including prototype.js?
2) it says that it will not show divs that were hidden via css?!  how
else would i hide a div?  if i want the div to be hidden when the page
loads, and then toggled when a link is clicked, how woudl i do that if
i cant set the css for the div to display:none ??

On Nov 27, 2:46 pm, bdee1 <[EMAIL PROTECTED]> wrote:
> ok i am brand new to prototype (i am used to using jquery).  i have a
> div with a class of "search" and i would like to make it so that when
> a link is clicked, the div's visibility will toggle (if its hidden it
> will be shown, if it is visible it will hide).
>
> so i was thinking that in the onClick attribute of the a tag i would
> put a simple statement like $('.search').toggle  but that is the
> jquery way.  looking through some tutorials for prototype it looks
> like it would have to be more like this:
>
> allNodes = document.getElementsByClassName("search");
> for(i = 0; i < allNodes.length; i++) {
>     allNodes[i].toggle();
>
> }
>
> but from what i am seeing, i would also need to include scriptaculous
> to get the toggle functionality is that correct?
>
> and this seems like a lot of code (compared to jQuery) just to get a
> div to toggle.  am i missing something?  is there a quicker way?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to