daveCph-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jun-07 13:24 UTC
total noob in trouble - content of a loaded section "blinks" before ffading in
This is a question regarding prototype and scriptaculous. I have a div with the id="container" in a html file (and not much else), and another html file that I wish to load inside the "container" div. I want the content to fade in (appear), not just appear completly, but before the fading begins the new content sort of blinks or flashes. Please help me to understand. this is the javascript I use: <!-- window.onload = function(){ Event.observe( ''container'', //the id of the target div ''click'', // the event function(evt){ new Ajax.Updater( ''container'', ''templates/includes/houseImagesInclude.html'', //the path to the file I wish to load { method: ''get'', onComplete : function(){ Effect.Appear(''container'' ,{from:0, to:1, duration:2} ); } } ); } ); } --> Best regards Dave from Copenhagen --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Diodeus
2007-Jun-08 14:16 UTC
Re: total noob in trouble - content of a loaded section "blinks" before ffading in
1) Load your content into a hidden DIV 2) Copy the content from the hidden DIV to your target DIV after it has loaded 3) Run your effect on the target DIV There might be a better way, but that''s how I worked-around that particular problem On Jun 7, 9:24 am, "dave...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <dave...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> This is a question regarding prototype and scriptaculous. > > I have a div with the id="container" in a html file (and not much > else), and another html file that I wish to load inside the > "container" div. I want the content to fade in (appear), not just > appear completly, but before the fading begins the new content sort of > blinks or flashes. > > Please help me to understand. > > this is the javascript I use: > <!-- > window.onload = function(){ > Event.observe( > ''container'', //the id of the target div > ''click'', // the event > function(evt){ > new Ajax.Updater( > ''container'', > ''templates/includes/houseImagesInclude.html'', //the path to the > file I wish to load > { > method: ''get'', > onComplete : function(){ > Effect.Appear(''container'' ,{from:0, to:1, duration:2} ); > } > } > ); > } > );} > > --> > > Best regards > > Dave from Copenhagen--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Chris McCormack
2007-Jun-15 07:50 UTC
Re: total noob in trouble - content of a loaded section "blinks" before ffading in
Horrible problem this. Easy fix is to set opacity on the target div to 0.01 before using its innerHTML method. Also works on fade out / populate / fade in problem. Chris On Jun 8, 3:16 pm, Diodeus <diod...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 1) Load your content into a hidden DIV > 2) Copy the content from the hidden DIV to your target DIV after it > has loaded > 3) Run your effect on the target DIV > > There might be a better way, but that''s how I worked-around that > particular problem > > On Jun 7, 9:24 am, "dave...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <dave...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > This is a question regarding prototype and scriptaculous. > > > I have a div with the id="container" in a html file (and not much > > else), and another html file that I wish to load inside the > > "container" div. I want the content to fade in (appear), not just > > appear completly, but before the fading begins the new content sort of > > blinks or flashes. > > > Please help me to understand. > > > this is the javascript I use: > > <!-- > > window.onload = function(){ > > Event.observe( > > ''container'', //the id of the target div > > ''click'', // the event > > function(evt){ > > new Ajax.Updater( > > ''container'', > > ''templates/includes/houseImagesInclude.html'', //the path to the > > file I wish to load > > { > > method: ''get'', > > onComplete : function(){ > > Effect.Appear(''container'' ,{from:0, to:1, duration:2} ); > > } > > } > > ); > > } > > );} > > > --> > > > Best regards > > > Dave from Copenhagen--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---