Jeremy Chen
2007-Feb-23 22:32 UTC
draggable breaks once mouse is outside the browser window
Currently, my draggable element stops moving when my mouse moves out of the browser window. If i do an onmouseup outside the window area, and come back in the window, the draggable element will follow my pointer until I click again. At that time, the draggable element stays at that position and will not revert. I can fix this problem by adding calling endDrag() on the window object''s onmouseout. However this only works in firefox because I believe IE doesnt allow events to be attached on the window object. I know there is probably multiple solutions to this problem, but just looking for an elegant cross-browser solution. thank you! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Tom Gregory
2007-Feb-24 03:03 UTC
Re: draggable breaks once mouse is outside the browser window
This isn''t something I''ve played with, although I''ve got a user complaining of the same problem. Have you tried attaching it to the document or body? You could also wrap all content in a div... ...And IE does allow attaching some events to window, "onload" being the most used. =) TAG On Feb 23, 2007, at 3:32 PM, Jeremy Chen wrote:> Currently, my draggable element stops moving when my mouse moves > out of the browser window. If i do an onmouseup outside the window > area, and come back in the window, the draggable element will > follow my pointer until I click again. At that time, the draggable > element stays at that position and will not revert. > I can fix this problem by adding calling endDrag() on the window > object''s onmouseout. However this only works in firefox because I > believe IE doesnt allow events to be attached on the window object. > I know there is probably multiple solutions to this problem, but > just looking for an elegant cross-browser solution. > > thank you! > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
IE has another way to handle this (of course!!) it''s setCapture method Look at this: http://dev.rubyonrails.org/ticket/3265 Seb On Feb 23, 11:32 pm, "Jeremy Chen" <jin1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Currently, my draggable element stops moving when my mouse moves out of the > browser window. If i do an onmouseup outside the window area, and come back > in the window, the draggable element will follow my pointer until I click > again. At that time, the draggable element stays at that position and will > not revert. > I can fix this problem by adding calling endDrag() on the window object''s > onmouseout. However this only works in firefox because I believe IE doesnt > allow events to be attached on the window object. > I know there is probably multiple solutions to this problem, but just > looking for an elegant cross-browser solution. > > thank you!--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jin1212-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Feb-26 16:09 UTC
Re: draggable breaks once mouse is outside the browser window
nice one! thank you On Feb 24, 12:29 pm, "seb" <sgruh...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> IE has another way to handle this (of course!!) it''s setCapture method > > Look at this:http://dev.rubyonrails.org/ticket/3265 > > Seb > > On Feb 23, 11:32 pm, "Jeremy Chen" <jin1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Currently, my draggable element stops moving when my mouse moves out of the > > browser window. If i do an onmouseup outside the window area, and come back > > in the window, the draggable element will follow my pointer until I click > > again. At that time, the draggable element stays at that position and will > > not revert. > > I can fix this problem by adding calling endDrag() on the window object''s > > onmouseout. However this only works in firefox because I believe IE doesnt > > allow events to be attached on the window object. > > I know there is probably multiple solutions to this problem, but just > > looking for an elegant cross-browser solution. > > > thank you!- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---