Mark, you can put in your view something like this: <?php e($html->imageTag('loading.gif','Loading...',array('id'=>'spinning_image','style'=>'display:none'))) ?> Note the "id" set to "spinning image" end the style set to "display:none" so the image is not displayed as default
Then your ajax link can be: $ajax_link_options = array('complete'=>..., 'update'=>..., 'loading'=>"Element.show('spinning_image');") e($ajax->link('Click here!', '/controller/action/', $ajax_link_options, null,false)); note the 'loading' option in $ajax_link_options you can see the avaiable options in the API at http://api.cakephp.org/class_ajax_helper.html#e9b39f961e4c9fd0c8a09b41532b6125 stefano markiemark wrote: > Hi every one, > > I have got a short question. Is it possible to show a spinning gif when > clicking on a $ajax->link in cakephp when al the data in the targetdiv > is loading. this is very usefull with slow connections or a lot of > images being loaded in the div. > > hope anyone knows the answer and can tell me how to do this. > > cheers, > > mark --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---