Does anyone know why this would work in FF2 but not IE7? Event.observe(window, ''mousemove'', pMenu.watching); pMenu = { ..... watching: function(ev) { do stuff }, ..... }; Thanks, RR --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Dashifen Kees
2007-Jun-19 19:29 UTC
Re: Event.observe working on FF but not IE... ???
I don''t think IE has a mouse movement event. I could be wrong. Hell, I didn''t now FireFox did have a mousemove event! - Dash - RighteousRaven wrote:> Does anyone know why this would work in FF2 but not IE7? > > Event.observe(window, ''mousemove'', pMenu.watching); > > pMenu = { > ..... > watching: function(ev) { > do stuff > }, > ..... > }; > > Thanks, > RR > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That''s not the problem. Drag/drop lives (and dies) on the mousemove event. It''s a bit hard to help without a complete, minimal code sample (and the specific, unhelpful IE error message). I have two suggestions: 1. Check to make sure you don''t have a trailing comma after the last element your curly braces. (Common problem) 2. Because you posted an edited sample.... are you sure the observe() is being called *after* pMenu is defined? TAG On Jun 19, 2007, at 1:29 PM, David Dashifen Kees wrote:> > I don''t think IE has a mouse movement event. I could be wrong. > Hell, I > didn''t now FireFox did have a mousemove event! > > - Dash - > > RighteousRaven wrote: >> Does anyone know why this would work in FF2 but not IE7? >> >> Event.observe(window, ''mousemove'', pMenu.watching); >> >> pMenu = { >> ..... >> watching: function(ev) { >> do stuff >> }, >> ..... >> }; >> >> Thanks, >> RR--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
David Dashifen Kees
2007-Jun-19 20:12 UTC
Re: Event.observe working on FF but not IE... ???
D''oh! That''s what I get for shooting from the hip (and not reading the scriptaculous code)! - Dash - Tom Gregory wrote:> That''s not the problem. Drag/drop lives (and dies) on the mousemove > event. > > It''s a bit hard to help without a complete, minimal code sample (and > the specific, unhelpful IE error message). > > I have two suggestions: > 1. Check to make sure you don''t have a trailing comma after the last > element your curly braces. (Common problem) > 2. Because you posted an edited sample.... are you sure the observe() > is being called *after* pMenu is defined? > > > TAG > > On Jun 19, 2007, at 1:29 PM, David Dashifen Kees wrote: > > >> I don''t think IE has a mouse movement event. I could be wrong. >> Hell, I >> didn''t now FireFox did have a mousemove event! >> >> - Dash - >> >> RighteousRaven wrote: >> >>> Does anyone know why this would work in FF2 but not IE7? >>> >>> Event.observe(window, ''mousemove'', pMenu.watching); >>> >>> pMenu = { >>> ..... >>> watching: function(ev) { >>> do stuff >>> }, >>> ..... >>> }; >>> >>> Thanks, >>> RR >>> > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> It''s a bit hard to help without a complete, minimal code sample (and > the specific, unhelpful IE error message).That''s part of what is weird... there is no error message. The observed function just isnt getting called in IE.... but its perfect in FF.> 1. Check to make sure you don''t have a trailing comma after the last > element your curly braces. (Common problem)Not it...> 2. Because you posted an edited sample.... are you sure the observe() > is being called *after* pMenu is defined?observe() is being called within pMenu.show(), with the mousemove event calling pMenu.watching(). I tried rearranging the order of the definitions of show and watching, but to no avail. I had thought that Event.observe was supposed to be cross browser, and without an error message I feel super-lost. RR --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Short answer: IE doesn''t look for the mousemove event on the window object. Use document instead. (There might be a patch here if the devs think it''s important-- Event.observe already catches ''keypress'' in Safari, and converts it to ''keydown'') TAG ===================================Proof: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>untitled</title> <script type="text/javascript" src="js/prototype.js"></script> <script type="text/javascript"> function watch(e) { $(''debug'').update( ''[ X: '' + Event.pointerX(e) + '' / Y: '' + Event.pointerY(e) +'' ]\n'' ); } window.onload = function () { $(''debug'').update(''Loading ...''); Event.observe(window, ''mousemove'', watch); // Change window w/ document //window.onmousemove = watch; $(''debug'').update(''Loaded.''); } </script> </head> <body> <pre id="debug">(empty)</pre> </body> </html> On Jun 19, 2007, at 2:18 PM, RighteousRaven wrote:>> It''s a bit hard to help without a complete, minimal code sample (and >> the specific, unhelpful IE error message). > > That''s part of what is weird... there is no error message. The > observed function just isnt getting called in IE.... but its perfect > in FF. > > >> 1. Check to make sure you don''t have a trailing comma after the last >> element your curly braces. (Common problem) > > Not it... > >> 2. Because you posted an edited sample.... are you sure the observe() >> is being called *after* pMenu is defined? > > observe() is being called within pMenu.show(), with the mousemove > event calling pMenu.watching(). I tried rearranging the order of the > definitions of show and watching, but to no avail. > > I had thought that Event.observe was supposed to be cross browser, and > without an error message I feel super-lost. > > RR > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
It looks like that was it. I just made the change and it works perfectly. Thanks Tom. RR On Jun 19, 5:09 pm, Tom Gregory <t...-PGZyUNKar/Q@public.gmane.org> wrote:> Short answer: IE doesn''t look for the mousemove event on the window > object. Use document instead. > > (There might be a patch here if the devs think it''s important-- > Event.observe already catches ''keypress'' in Safari, and converts it > to ''keydown'') > > TAG > ===================================> Proof: > <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" > "http://www.w3.org/TR/html4/strict.dtd"> > <html> > <head> > <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> > <title>untitled</title> > <script type="text/javascript" src="js/prototype.js"></script> > <script type="text/javascript"> > function watch(e) { > $(''debug'').update( > ''[ X: '' + Event.pointerX(e) + '' / Y: '' + Event.pointerY(e) +'' ]\n'' > ); > > } > > window.onload = function () { > $(''debug'').update(''Loading ...''); > Event.observe(window, ''mousemove'', watch); // Change window w/ document > //window.onmousemove = watch; > $(''debug'').update(''Loaded.'');} > > </script> > </head> > <body> > <pre id="debug">(empty)</pre> > </body> > </html> > > On Jun 19, 2007, at 2:18 PM, RighteousRaven wrote: > > >> It''s a bit hard to help without a complete, minimal code sample (and > >> the specific, unhelpful IE error message). > > > That''s part of what is weird... there is no error message. The > > observed function just isnt getting called in IE.... but its perfect > > in FF. > > >> 1. Check to make sure you don''t have a trailing comma after the last > >> element your curly braces. (Common problem) > > > Not it... > > >> 2. Because you posted an edited sample.... are you sure the observe() > >> is being called *after* pMenu is defined? > > > observe() is being called within pMenu.show(), with the mousemove > > event calling pMenu.watching(). I tried rearranging the order of the > > definitions of show and watching, but to no avail. > > > I had thought that Event.observe was supposed to be cross browser, and > > without an error message I feel super-lost. > > > RR--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---