Oh yeah... and this was your problem;
onclick='Effect.toggle('blinddown1', 'slide'); return false;'>
would've worked as:
onclick="Effect.toggle('blinddown1', 'slide'); return false;">
You cant use single quotes inside of single quotes.
On Thu, Jun 4, 2009 at 12:37 AM, Rick Waldron <[email protected]>wrote:
> There is a much cleaner way to do this... check it out (tested and passed)
>
> This goes in <script> tags, or in your external js file:
>
>
> document.observe('dom:loaded', function () {
> $$('.blinders').each(function (b) {
>
> b.observe('click', function () {
> this.next().toggle('blinddown', 'slide');
> });
> });
> });
>
>
>
> And the PHP really should be written like this:
> <?php
>
> $count=$count+2;
> while ( $count <= $num_teams)
> {
> ?>
> <tr>
> <td>Player <?php echo $count ?></td>
> <td class='players'>
> <div class="blinders red">
> {click to reserve a player spot}
> </div>
> <div style='display:none; width:175px;height:100px;
> background:#FFF;'>
> Random Text that doesn't matter
> </div>
> </td>
> </tr>
> <?php
> $count++;
> }
> ?>
>
> Notice only ONE var is echo'ed. with all those double quotes your asking
> PHP to eval everything inside it, even when there are no vars to parse -
> thats not fair to PHP.
>
> Having inline handlers is something you will vastly regret in the future,
> so i did away with those and let the .each() deal with assigning behaviours
>
> Tested in FF3 & IE 7
>
>
> Rick
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> $count=$count+2;
> while ($count<=$num_teams)
> {
>
> echo '<tr><td>Player ".$count . "</td><td class='players'><div
> onclick='Effect.toggle('
>>
>> blinddown".$count."', 'slide'); return
>> false;'><span class='red'>{click to reserve a player spot}</span></
>> div>
>> <div id='blinddown".$count."'style='display:none; width:175px;
>> height:
>> 100px; background:#FFF;'>Random Text that doesn't matter</div></td></
>> tr>";
>> $count++;
>> }
>>
>
>
>
> On Wed, Jun 3, 2009 at 7:13 PM, craig <[email protected]> wrote:
>
>>
>> That's right, yes. I tried that at one point:
>>
>> $count=$count+2;
>> while ($count<=$num_teams)
>> {
>> echo "<tr><td>Player ".$count . "</td><td class='players'><div
>> onclick='Effect.toggle('blinddown".$count."', 'slide'); return
>> false;'><span class='red'>{click to reserve a player spot}</span></
>> div>
>> <div id='blinddown".$count."'style='display:none; width:175px;
>> height:
>> 100px; background:#FFF;'>Random Text that doesn't matter</div></td></
>> tr>";
>> $count++;
>> }
>>
>> However, it still wasn't working, so I decided to mess around with it
>> and just hard-code 1 in there. In my previous experience it will
>> toggle the first occurrence of the div id, so I was just trying to
>> avoid potential syntax errors until I figured it out...but I still
>> have not
>> >>
>>
>
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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
-~----------~----~----~----~------~----~------~--~---