//index.thtml

<div id="faq"></div>
<?php echo $ajax->link('FAQ/HELP', '/books/faq', array('update' =>
'faq')); ?>

<?php
for ($i = 0; $i < 10; $i++){
$view = 'view' . $i;
echo "<div id=$view></div>";
options = array(
'update'   => "$view",
'url'      => "/books/lister/?id=$i,
'type'     => 'asynchronous',
'loading'  => "Element.hide($view);",
'complete' => "Effect.Appear($view);"
);
echo $javascript->event('window','load',$ajax-
>remoteFunction($options),false);
}
?>

The index.thtml will show you 50 <div>s when loaded, that is
<div id="view0"> .....</div>
<div id="view1"> .....</div>
<div id="view2"> .....</div>
.....
<div id="view49"> .....</div>.

When the 'FAQ/HELP' button is clicked, <div id="faq"> .....</div> will
be displayed on the top, so that we can see
<div id="faq"> .....</div>
<div id="view0"> .....</div>
<div id="view1"> .....</div>
<div id="view2"> .....</div>
.....
<div id="view49"> .....</div>.

But what I want to do is to hide all <div>s except for <div id="faq">
when 'FAQ/HELP' button is clicked so that we can see only
<div id="faq"> .....</div>.

I guess adding something like 'loading'  =>
"Element.hide($view0);Element.hide($view0);....;Element.hide($view49);"
into the option array could do it. But there are too many <div>s to
hide, and there could be easier way of doing this.


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

Reply via email to