Hi there, I''m now having an odd problem with Effect.Fade not working based on the innerHTML of a div. Take the following for example... <div id="blah"> Nothing here yet. </div> If I then update "blah", hide it and then fade it in, like so: <script type="text/javascript"> document.getElementById("blah").innerHTML = ''<div id="box">Box content goes here</div>''; Element.hide(''box''); new Effect.Appear(''box'', {duration: 3}); </script> That works beautifully. However, if I attempt to fade out "box" after approximately 20 seconds, nothing happens at all..... I''m attempting to fade out using: new Effect.Fade(''box''); If I reload the page, which PHP produces, which already contains the div''s in place - fade works perfectly. Any ideas? The only difference I can see between the content of the current div and the new div, is the opacity level. Should this make a difference? TIA, Rich. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I too am looking to do something similar to this. I think the issue you are running into is your innerHTML and Fade In should occur after the Fade Out is finished, however there is not an onComplete option for Effect.Fade. It would need to look something like this: new Effect.Fade(''caption'', {to:0.0, duration: .3, onComplete: function(){ $(''caption'').innerHTML = caption; new Effect.Fade(''caption'', {to:1.0, duration: .3 }); } }); Unfortunately, I''ve had no luck with an onComplete with Effect.Appear, Effect.Fade, or Effect.Opacity. I wish i could contribute to Script.aculo.us but I wouldn''t know where to begin to add this feature. On Jun 7, 5:00 pm, Rich <rfl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi there, > > I''m now having an odd problem with Effect.Fadenot working based on > theinnerHTMLof a div. > > Take the following for example... > > <div id="blah"> > Nothing here yet. > </div> > > If I then update "blah", hide it and thenfadeit in, like so: > > <script type="text/javascript"> > document.getElementById("blah").innerHTML= ''<div id="box">Box content > goes here</div>''; > Element.hide(''box''); > new Effect.Appear(''box'', {duration: 3}); > </script> > > That works beautifully. > > However, if I attempt tofadeout "box" after approximately 20 > seconds, nothing happens at all..... > > I''m attempting tofadeout using: > > new Effect.Fade(''box''); > > If I reload the page, which PHP produces, which already contains the > div''s in place -fadeworks perfectly. Any ideas? The only > difference I can see between the content of the current div and the > new div, is the opacity level. Should this make a difference? > > TIA, > Rich.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Isn''t this where Effect Queues are used? http://wiki.script.aculo.us/scriptaculous/show/EffectQueues Walter On Aug 6, 2007, at 10:50 AM, briandichiara wrote:> I too am looking to do something similar to this. I think the issue > you are running into is your innerHTML and Fade In should occur after > the Fade Out is finished, however there is not an onComplete option > for Effect.Fade. > > It would need to look something like this: > > > new Effect.Fade(''caption'', {to:0.0, duration: .3, onComplete: > function(){ > $(''caption'').innerHTML = caption; > new Effect.Fade(''caption'', {to:1.0, duration: .3 }); > } > }); > > Unfortunately, I''ve had no luck with an onComplete with Effect.Appear, > Effect.Fade, or Effect.Opacity. I wish i could contribute to > Script.aculo.us but I wouldn''t know where to begin to add this > feature.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That''s what I was just looking into. Realized that after I posted, but as you can see from my latest post (http://groups.google.com/group/ rubyonrails-spinoffs/browse_thread/thread/a26f1fcbcc56f8ae?hl=en), I cannot figure out how to "insert" the innerHTML part between the 2 fades... On Aug 6, 10:17 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> Isn''t this where Effect Queues are used? > > http://wiki.script.aculo.us/scriptaculous/show/EffectQueues > > Walter > > On Aug 6, 2007, at 10:50 AM, briandichiara wrote: > > > I too am looking to do something similar to this. I think the issue > > you are running into is your innerHTML and Fade In should occur after > > the Fade Out is finished, however there is not an onComplete option > > for Effect.Fade. > > > It would need to look something like this: > > > new Effect.Fade(''caption'', {to:0.0, duration: .3, onComplete: > > function(){ > > $(''caption'').innerHTML = caption; > > new Effect.Fade(''caption'', {to:1.0, duration: .3 }); > > } > > }); > > > Unfortunately, I''ve had no luck with an onComplete with Effect.Appear, > > Effect.Fade, or Effect.Opacity. I wish i could contribute to > > Script.aculo.us but I wouldn''t know where to begin to add this > > feature.--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try using Element.update (from prototype.js) and include the "after" part in a <script> block in the code that you insert through update. After the replacement happens, the code will run. I don''t have any suggestions about how to get the update to run after the initial effect has happened, but you might want to just use a setTimeout for that. Walter On Aug 6, 2007, at 11:32 AM, briandichiara wrote:> > That''s what I was just looking into. Realized that after I posted, but > as you can see from my latest post (http://groups.google.com/group/ > rubyonrails-spinoffs/browse_thread/thread/a26f1fcbcc56f8ae?hl=en), I > cannot figure out how to "insert" the innerHTML part between the 2 > fades... > > On Aug 6, 10:17 am, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote: >> Isn''t this where Effect Queues are used? >> >> http://wiki.script.aculo.us/scriptaculous/show/EffectQueues >> >> Walter >> >> On Aug 6, 2007, at 10:50 AM, briandichiara wrote: >> >>> I too am looking to do something similar to this. I think the issue >>> you are running into is your innerHTML and Fade In should occur after >>> the Fade Out is finished, however there is not an onComplete option >>> for Effect.Fade. >> >>> It would need to look something like this: >> >>> new Effect.Fade(''caption'', {to:0.0, duration: .3, onComplete: >>> function(){ >>> $(''caption'').innerHTML = caption; >>> new Effect.Fade(''caption'', {to:1.0, duration: .3 }); >>> } >>> }); >> >>> Unfortunately, I''ve had no luck with an onComplete with >>> Effect.Appear, >>> Effect.Fade, or Effect.Opacity. I wish i could contribute to >>> Script.aculo.us but I wouldn''t know where to begin to add this >>> feature. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---