Hello,
I've created a nice function using prototype and scriptaculous. Very
limited but with a very nice effect. Essentially, when ever i call
ajax i show a loading indicator and then hide the indicator and use
the effect.Appear effect to show the content returned. Here's my
sample:

http://www.servandomontero.com/test/test_ajax/index.html

My question is how i can i pass an element id to the
Ajax.Responders.register 'listener'.

In the code below, in the function 'update_div' i use a
'div' (el_div). That div (el_div) should be use in the
Ajax.Responders.register but i don't know how to pass that parameter

So instead of $('products').hide(); it should be something like : $
(el_div).hide();

Can i pass parameters to the Ajax.Responders.register from the
function update_div?


CODE:
------------
Ajax.Responders.register({
onCreate: function() {
        if($('loading_box') && Ajax.activeRequestCount>0)
                $('products').hide(); // *** SHOULD BE $(el_div).hide();
                $('loading_box').show();
        },
onComplete: function() {
    if($('loading_box') && Ajax.activeRequestCount==0)
                $('loading_box').hide();
                Effect.Appear('products', {duration:1.0, queue:'end'}); // ***
SHOULD BE Effect.Appear(el_div, {duration:1.0, queue:'end'});
        }
});


----------

function update_div(el_div, url) {
        new Ajax.Updater({success:el_div}, url, {method:'get'});
}

------------



Can i pass parameter to the Ajax.Responders.register ?

Thanks
marco
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to