jakobmetzger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2006-Nov-21 05:06 UTC
onclick will trigger multipe effects.
what I am trying to do is when a link is clicked using script.aculo.us and prototype to Effect.Fade out a seperate div, load new content with Ajax.Updater, then Effect.Appear the new content in the div. Im lost on how to do this is there isnt much documentation on protoype and script.aculo.us so do you guys have any suggestions? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Something like this (untested) code: <div id="myElement">old content</div> <a href="#" id="myLink">Link text...</a> <script type="text/javascript"> $(''myLink'').observe(''click'', function(event) { Event.stop(event); $(''myElement'').visualEffect(''fade'', { afterFinish: function() { new Ajax.Updater(''myElement'', ''content.html'', { onSuccess: function(response) { $(''myElement'').visualEffect(''appear''); } }) } }); }); </script> You''ll probably want to refactor it but it should at least give you a hint. On 11/21/06, jakobmetzger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <jakobmetzger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > what I am trying to do is when a link is clicked using script.aculo.us > and prototype to Effect.Fade out a seperate div, load new content with > Ajax.Updater, then Effect.Appear the new content in the div. Im lost on > how to do this is there isnt much documentation on protoype and > script.aculo.us so do you guys have any suggestions? > > > > >-- burnfield.com/martin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---