All, I''ve got will_paginate working with AJAX (using un-obstructive javascript, i.e. good for SEO). All good. When the user clicks "Next >>", I want the next page of results to fade in. But the problem seems to be (in the code below) that both page.replace_html and page.visual_effect get called at the same time. So the new div starts to fade in, then gets drawn completely (once the AJAX call has returned) ... then drops back to whichever fade level it was up to, then keeps going. page.replace_html "classical", :partial => ''view_summary'', :locals => { :my_files => @my_files} page.visual_effect :Opacity, "classical", :from => 0.0, :to => 1.0, :duration => 3 Is there a way that I can hold off running page.visual_effect until page.replace_html has completed? (BTW, havn''t had much luck with page.delay) Etienne --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Aaron Van Bokhoven
2009-Feb-20 07:30 UTC
Re: sequence of page.visual_effect and page.replace_html
Have you tried hiding the div right after you page.replace_html, then using page.visual_effect :Appear? Here''s an example of how I update my comment list with the same effect. page.replace_html ''comments'', :partial => ''blog/comment'', :collection => @comments page.hide ''comment_'' + @comment.id page.visual_effect :Appear, ''comment_'' + @comment.id -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi Aaron, yeah, for some reason Appear seems to work much better than the Opacity effect. The only issue I have now is that the whole page jumps around when I hide the Div ... I have to find some way of keeping its size when hiding .... urgh... css. Etienne> Have you tried hiding the div right after you page.replace_html, then > using page.visual_effect :Appear? > > Here''s an example of how I update my comment list with the same effect. > > page.replace_html ''comments'', :partial => ''blog/comment'', :collection => > @comments > page.hide ''comment_'' + @comment.id > page.visual_effect :Appear, ''comment_'' + @comment.id > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---