Hi guys,
I just started on AJAX and Scriptaculous/Prototype is looking great.
I have a problem integrating PHP with it.I generate this HTML page
based $query. It display a list of items: its name and its description
(currently using a placeholder for description).
Each item uses Effect.toggle(slide) to slide the description in and out
of the page when a user click on the item name.
How do I make the descriptions "hide" the first time I run the page?
i.e. don't show the <div> section at the start, only show it when a
user click on an Item Name.
Thanks for your help.
P/S: I am developing a Trading Card Game with Flash/AJAX/PHP with a
team.
The following is my code snippet:
-------------------------------------------------------
<?php
echo "<ul>\n";
foreach ($query->result() as $card) {
$a_out = sprintf("<li><a href ='#'
onClick=\"Effect.toggle('card-view-slide_%s',
'slide'); return
false\">%s</a></li>\n",
$card->idCard, $card->cardName);
$div_out = sprintf("<div
id=\"card-view-slide_%s\"><div>Description/Stats of %s</div></div>",
$card->idCard, $card->cardName);
echo $a_out;
echo $div_out;
}
echo "</ul>\n";
?>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---