Hi all,
Trying to get used to prtotype, I've written this code in jquery but
need a prototype equivalent. I've trawled the web for ages and read
pretty much a whole book (the Manning one with the turk on the front)
but I'm still none the wiser. Any help would be much appreciated. I've
got this html:

<ul class="bopCategories">
        <li>
                <h3 class="expanded">Heading One</h3>
                <div class="bopCategoryDetails">
                        Lorem ipsum dolor sit amet.
                </div>
        </li>
        <li>
                <h3 class="expanded">Heading Two</h3>
                <div class="bopCategoryDetails">
                        Lorem ipsum dolor sit amet.
                </div>
        </li>
</ul>

which I then toggle the showing/hiding of the <div>s when the <h3>s
are clicked with this jquery code:

                $("ul.bopCategories li h3").click(function(){

                        
$(this).siblings("div.bopCategoryDetails").toggle("fast");
                        $(this).toggleClass("expanded");

                });

How on earth do I do this with Prototype? So far I've only managed to
add an onclick event to every <h3> and pass the id of the specific
<div>. Like so:

        <h3 onclick="$('divvy2').toggle();">Event</h3>
        <div id="divvy2">
        Test test test test test test test test ets test test test test test
        </div>

Obviously this is going to get cumbersome when I have 20 or so list
items.
Thanks.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Prototype & script.aculo.us" group.
To post to this group, send email to prototype-scriptaculous@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/prototype-scriptaculous?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to