Hello, I am using the following code: new Ajax.Request(''ajax.php'', { parameters: { task: ''home'' }, onSuccess: function(transport) { $(''home_montage'').update(transport.responseText); new Effect.Appear( ''home_montage'', { duration: 3, from: 0, to: 0.8, }); } } ); The transort.responseText contains images and I would like, the effect Appear to start only once all the images are loaded in the cache of the browser. How could I achieve that? Thanks ____________________________________________________________________________________ Park yourself in front of a world of choices in alternative vehicles. Visit the Yahoo! Auto Green Center. http://autos.yahoo.com/green_center/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
On firefox I use observe(''load'', func) but in IE there was a problems (as always) : { loadImage: function (img) // part for IE hack { this.timer = new PeriodicalExecuter(function(img) { $(''notice'').innerHTML = ''<img src="'' + img.src + ''" />''; if (img.complete) { this.timer.stop(); this.timer = null; this.eventLoad(); } }.bind(this, img), .40); }, eventLoad: funcion() { // some action apear effect maybe } } // strange but it was working some how --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hello, Thanks for the answer. I am going to explore that road. Does that mean there is no solution to my problem within the framework of prototypejs or scriptaculous? I was thinking that if update() could become an effect, then I could, maybe, use afterFinish. I am pretty junior, so I am not sure if it is feasible and whether there is an interest for such feature. regards ----- Original Message ---- From: Радослав Станков <RStankov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> To: Ruby on Rails: Spinoffs <rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Sent: Sunday, August 26, 2007 7:38:35 AM Subject: [Rails-spinoffs] Re: onLoad event with an update function On firefox I use observe(''load'', func) but in IE there was a problems (as always) : { loadImage: function (img) // part for IE hack { this.timer = new PeriodicalExecuter(function(img) { $(''notice'').innerHTML = ''<img src="'' + img.src + ''" />''; if (img.complete) { this.timer.stop(); this.timer = null; this.eventLoad(); } }.bind(this, img), .40); }, eventLoad: funcion() { // some action apear effect maybe } } // strange but it was working some how ____________________________________________________________________________________ Need a vacation? Get great deals to amazing places on Yahoo! Travel. http://travel.yahoo.com/ --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Image loading in browser happens asynchronously, and has various quirks-- there''s no easy API that works crossbrowser. You''d need some sort of image loading library that you can feed with the image URLs you receive, wait for all to load, then do the effect (again, this is non-trivial). Maybe someone in the community has written a libary for that? Best, Thomas Am 27.08.2007 um 00:50 schrieb Jean-Christophe Roux:> Hello, > > Thanks for the answer. I am going to explore that road. Does that > mean there is no solution to my problem within the framework of > prototypejs or scriptaculous? I was thinking that if update() could > become an effect, then I could, maybe, use afterFinish. I am pretty > junior, so I am not sure if it is feasible and whether there is an > interest for such feature. > regards > > > ----- Original Message ---- > From: Радослав Станков <RStankov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > To: Ruby on Rails: Spinoffs <rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Sent: Sunday, August 26, 2007 7:38:35 AM > Subject: [Rails-spinoffs] Re: onLoad event with an update function > > > On firefox I use observe(''load'', func) but in IE there was a problems > (as always) : > > { > loadImage: function (img) // part for IE hack > { > this.timer = new PeriodicalExecuter(function(img) > { > $(''notice'').innerHTML = ''<img src="'' + img.src + ''" />''; > if (img.complete) > { > this.timer.stop(); > this.timer = null; > this.eventLoad(); > } > }.bind(this, img), .40); > }, > eventLoad: funcion() > { > // some action apear effect maybe > } > } > > // strange but it was working some how > > > Building a website is a piece of cake. > Yahoo! Small Business gives you all the tools to get online. > > >--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Thomas and others, I know it was not key part of the question, but regarding Image loading I stumbled across a YUI lib (sorry for that :)) you might want to check it out. http://developer.yahoo.com/yui/imageloader/ It has some neat features. perhaps a good source of code and ideas to work with? .: Fabian -----Ursprüngliche Nachricht----- Von: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Gesendet: 27.08.07 01:47:48 An: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org Betreff: [Rails-spinoffs] Re: onLoad event with an update function Image loading in browser happens asynchronously, and has various quirks-- there''s no easy API that works crossbrowser. You''d need some sort of image loading library that you can feed with the image URLs you receive, wait for all to load, then do the effect (again, this is non-trivial). Maybe someone in the community has written a libary for that? Best, Thomas _______________________________________________________________________ Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate kostenlos testen. http://www.pc-sicherheit.web.de/startseite/?mc=022220 --~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Which isn''t much of an unobtrusive solution unless you do some server side user agent sniffing. On Aug 26, 9:39 pm, Fabian Lange <fabian.la...-S0/GAf8tV78@public.gmane.org> wrote:> Hi Thomas and others, > I know it was not key part of the question, but regarding Image loading I stumbled across a YUI lib (sorry for that :)) > you might want to check it out.http://developer.yahoo.com/yui/imageloader/ > It has some neat features. perhaps a good source of code and ideas to work with? > .: Fabian > > -----Ursprüngliche Nachricht----- > Von: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Gesendet: 27.08.07 01:47:48 > An: rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org > Betreff: [Rails-spinoffs] Re: onLoad event with an update function > > Image loading in browser happens asynchronously, and has various > quirks-- there''s no easy API that works crossbrowser. > > You''d need some sort of image loading library that you can feed with > the image URLs you receive, wait for all to load, then do the effect > (again, this is non-trivial). Maybe someone in the community has > written a libary for that? > > Best, > Thomas > > _______________________________________________________________________ > Jetzt neu! Schützen Sie Ihren PC mit McAfee und WEB.DE. 3 Monate > kostenlos testen.http://www.pc-sicherheit.web.de/startseite/?mc=022220--~--~---------~--~----~------------~-------~--~----~ 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 rubyonrails-spinoffs-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-spinoffs-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-spinoffs?hl=en -~----------~----~----~----~------~----~------~--~---
Maybe Matching Threads
- PeriodicalExecuter passing variables to the callback function
- Managing PeriodicalExecuters in an Ajax app. How?
- Does Ajax.PeriodicalUpdater have a shield against multiple parallel executions?
- Recalcitrant CSS background-image
- Does prototype get rid of PeriodicalExecuter once it is stop()?