fusero
2008-May-24 09:57 UTC
Effects work on a div but not on another div retrieved with ajax
Hi all, maybe somebody can help me. I have this sequence applied to ''matrix'' div (and it works): Effect.Fade(''matrix'', { duration: 1.0, afterFinish: function() { document.getElementById(''screen'').innerHTML = result; Effect.Appear(''matrix'', { duration: 1.0 }); } }); ''screen'' is another div, that is inside ''matrix'' along with more stuff. My problem is that if i apply the effects to the ''screen'' div (its content is being changed between the two effects): Effect.Fade(''screen'', { duration: 1.0, afterFinish: function() { document.getElementById(''screen'').innerHTML = result; Effect.Appear(''screen'', { duration: 1.0 }); } }); it doesn''t work. It do some weird things (instead my desired effects) and the ''screen'' div ends dissappearing. The only difference between the ''matrix'' and the ''screen'' div, is that the second doesn''t exist when the page is loaded, it is loaded inside ''matrix'' through an ajax call. After this, i try to aplly the effects. I have tried with another div wrapping the ''screen'' div, but same strange things... I also tried creating an empty ''screen'' div inside ''matrix'' div in order to have a ''screen'' div existing in my page before the first ajax call... no results any clue on where it''s my problem? --~--~---------~--~----~------------~-------~--~----~ 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
2008-May-26 15:50 UTC
Re: Effects work on a div but not on another div retrieved with ajax
See if it behaves the same way with a simple Element.show, it may give you a clue as to whether the effect of the problem or the HTML. On May 24, 5:57 am, fusero <fus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > maybe somebody can help me. I have this sequence applied to ''matrix'' > div (and it works): > > Effect.Fade(''matrix'', { duration: 1.0, afterFinish: function() > { document.getElementById(''screen'').innerHTML = result; > Effect.Appear(''matrix'', { duration: 1.0 }); } }); > > ''screen'' is another div, that is inside ''matrix'' along with more > stuff. My problem is that if i apply the effects to the ''screen'' div > (its content is being changed between the two effects): > > Effect.Fade(''screen'', { duration: 1.0, afterFinish: function() > { document.getElementById(''screen'').innerHTML = result; > Effect.Appear(''screen'', { duration: 1.0 }); } }); > > it doesn''t work. It do some weird things (instead my desired effects) > and the ''screen'' div ends dissappearing. > > The only difference between the ''matrix'' and the ''screen'' div, is that > the second doesn''t exist when the page is loaded, it is loaded inside > ''matrix'' through an ajax call. After this, i try to aplly the effects. > > I have tried with another div wrapping the ''screen'' div, but same > strange things... I also tried creating an empty ''screen'' div inside > ''matrix'' div in order to have a ''screen'' div existing in my page > before the first ajax call... no results > > any clue on where it''s my problem?--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---