chrispostfuture-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Apr-11 16:30 UTC
No effect with OnSuccess
I can get the new content to update without issue. To make it look pretty, I would like it to fade in or Appear. But it looks like I''m missing something. <a href="#" onClick="new Ajax.Updater(''swapper'', ''test2.html'', {onSuccess: function() {Effect.Appear(''swapper'', { duration: 2.0 });}, }); return false; "> --~--~---------~--~----~------------~-------~--~----~ 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, chrispostfuture-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org a écrit :> I can get the new content to update without issue. To make it look > pretty, I would like it to fade in or Appear. But it looks like I''m > missing something. > > <a href="#" onClick="new Ajax.Updater(''swapper'', ''test2.html'', > {onSuccess: function() {Effect.Appear(''swapper'', { duration: > 2.0 });}, }); return false; ">Can you check that your callback is actually called, e.g. with a console.log in Firebug, or an alert? Then try with putting a ''new'' before Effect.Appear (which is best practice anyhow). -- Christophe Porteneuve aka TDD tdd-x+CfDp/qHev2eFz/2MeuCQ@public.gmane.org --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
This is what I learned. I needed to use the "ReAppear" instead. ''swapper'' was already there, but for the effect to work I had to make sure the opacity would first be set to zero. <a href="#" onClick="new Ajax.Updater(''swapper'', ''test2.html'', {onSuccess: function() {Element.setOpacity(''swapper'', 0.0); new Effect.Appear(''swapper'');}, }); return false; "> Which is talked about here: http://ajaxian.com/archives/effectreappear-adding-news-updater-portlet-to-ajaxiancom Thanks again! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---