Hi. Has anyone ran into issues with the timing of page.delay. I have been testing in firefox, for the most part, and it seems that there is no reliability on when the page.delay timings kick in. What happens is that sometimes it will work fine, and the countdown looks great; other times it will just jump to the end and display everything at once, other times it will be jerky. I''m on a pretty powerful machine, so the javascript shouldn''t be causing system slowdowns, from what I can tell... Maybe I''m using it wrong? info.rjs 1. 2. page.visual_effect :fade, ''Infoname'', :duration => 0.5 3. page.visual_effect :fade, ''InfoDescription'', :duration => 0.5 4. page.visual_effect :fade, ''InfoButton'', :duratin => 0.5 5. page.delay(1.0) do 6. page.insert_html :top, ''countdown'', ''Info in..'' 7. end 8. page.delay(2.0) do 9. page.insert_html :bottom, ''countdown'', ''3'' 10. end 11. page.delay(2.3) do 12. page.insert_html :bottom, ''countdown'', ''.'' 13. end 14. page.delay(2.6) do 15. page.insert_html :bottom, ''countdown'', ''.'' 16. end 17. page.delay(3.0) do 18. page.insert_html :bottom, ''countdown'', ''2'' 19. end 20. page.delay(3.3) do 21. page.insert_html :bottom, ''countdown'', ''.'' 22. end 23. page.delay(3.6) do 24. page.insert_html :bottom, ''countdown'', ''.'' 25. end 26. page.delay(4.0) do 27. page.insert_html :bottom, ''countdown'', ''1'' 28. end 29. page.delay(4.5) do 30. page.replace_html ''countdown'', ''<div id="countdownGO">GO!</div>'' 31. page.visual_effect :puff, ''countdown'', :duration => 0.5 32. end 33. page.delay(5.0) do 34. page.visual_effect :fade, ''profile-indicator'' 35. page.replace_html ''info'', :partial => ''info/test'' 36. end Any ideas? Am I using the RJS template in a way it wasn''t designed, or extremely inefficient, that would cause it to be so erratic? Thank you for your help. -- 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 -~----------~----~----~----~------~----~------~--~---
Justin Cooper wrote:> Hi. > > Has anyone ran into issues with the timing of page.delay. I have been > testing in firefox, for the most part, and it seems that there is no > reliability on when the page.delay timings kick in. > SNIP > Thank you for your help.Try sticking a , :queue => "end" on the end of each of your page.somethingorother lines. Anytime I''ve ever tried to do multiple things in one set of rendering, this was needed in order to make it do what you would normally expect it to do. If I understand it correctly, this just forces it to do it all in the order that you have described it with your code. best, jp -- 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 -~----------~----~----~----~------~----~------~--~---
On 11/18/06, Justin Cooper <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > > Hi. > > Has anyone ran into issues with the timing of page.delay. I have been > testing in firefox, for the most part, and it seems that there is no > reliability on when the page.delay timings kick in. > > What happens is that sometimes it will work fine, and the countdown > looks great; other times it will just jump to the end and display > everything at once, other times it will be jerky. I''m on a pretty > powerful machine, so the javascript shouldn''t be causing system > slowdowns, from what I can tell... > > Maybe I''m using it wrong?You can''t rely on browser to launch timers in proper order. I would schedule next event only after previous event executed: page.delay 1 # count 1 page.delay 1 # count 2 page.delay 1 # count 3 end end end That is basics. For more advanced stuff you should get more familiar with Javascript and Prototype and write some component (e.g. CountdownTimer). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---