Hello! Short version : I need a tip on the right way to make repetitive calls to a function on mouseDown. mouseUp should make this repetitive call stop. Long version: In order to improve myself with javascript and prototype, i ''m trying to implement a custom scrollbar using prototype. I started to use the code found at jools : http://www.jools.net/ projects/javascript/scrollable-divs/ I''ve got the up and down arrow working for the onclick event, but i can''t get the "continuous scrolling" behavior right. I tried using a setInterval on mousedown, but it then triggers the function on pageload. So i''m now trying to use a Date object as some kind of timer to trigger the moveDown() function at regular intervals. Not much success yet. My question is: is this the right way at all? Is this something for which i must use "listeners" although i don''t really understand that concept? Thank you for your help ! Alex --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jan 28, 4:53 am, "pixeline" <aplennev...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello! > > Short version : > I need a tip on the right way to make repetitive calls to a function > on mouseDown. mouseUp should make this repetitive call stop.When the mousedown event occurs, add a mousemove event handler. When mouseup occurs, remove it. The mousemove handler looks at the event object to discover where the cursor is now compared to where it was last time the event was called and does stuff accordingly. Some browsers seem to call mousemove based on time, others on movement. A good cross-browser solution takes a lot of time and effort. There are many "draggable" libraries that use this method, including Scriptaculous: <URL: http://wiki.script.aculo.us/scriptaculous/show/Draggables > Some comparison libraries: YAHOO! - big and full-featured <URL: http://developer.yahoo.com/yui/dragdrop/ > FORK - minimalist but functional: <URL: http://forkjavascript.org/drag/tests > WalterZorn - detailed, specific to dragging and dropping: <URL: http://www.walterzorn.com/dragdrop/dragdrop_e.htm > -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Rails Spinoffers: This is a general question for discussion and research. In general, how would one architect tests to use a service like assert_ajax? What would it do? -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On Jan 29, 1:06 pm, "Phlip" <phlip2...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Rails Spinoffers: > > This is a general question for discussion and research. In general, how > would one architect tests to use a service like assert_ajax? What would it > do?If you wish to discuss a new topic, please start a new thread. -- Rob --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
RobG wrote:> If you wish to discuss a new topic, please start a new thread.I did. Something changed the subject line back. -- Phlip http://www.greencheese.us/ZeekLand <-- NOT a blog!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---