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