HI, I have this simple code: document.observe("dom:loaded", function() { var mensLink = $(''mens_link''); var womensLink = $(''womens_link''); mensLink.observe(''hover'', function(event){ alert(''hello''); }); }); which doesn''t work....if i replace the hover for the event to be observed with click it works.....any ideas what this problem can be....i have no other script on the page apart fom this....i just don''t ge it --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I always opt to use the ''mouseover'' event instead, and conversely, the ''mouseout'' event to undo anything that the ''mouseover'' event observer has done (such as adding a class name to an element for IE6). -justin --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Try with this: mensLink.observe(''mouseover'', function(event){.. .. .. .. On Wed, Feb 20, 2008 at 9:09 AM, elduderino <jamesfiltness-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > HI, > > I have this simple code: > > > document.observe("dom:loaded", function() { > var mensLink = $(''mens_link''); > var womensLink = $(''womens_link''); > mensLink.observe(''hover'', function(event){ > alert(''hello''); > }); > }); > > > which doesn''t work....if i replace the hover for the event to be > observed with click it works.....any ideas what this problem can > be....i have no other script on the page apart fom this....i just > don''t ge it > > >-- {a human being that was given to fly} --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
The event you want is mouseover, not hover. Hover is a css pseudo- selector. Walter On Feb 20, 2008, at 10:09 AM, elduderino wrote:> > HI, > > I have this simple code: > > > document.observe("dom:loaded", function() { > var mensLink = $(''mens_link''); > var womensLink = $(''womens_link''); > mensLink.observe(''hover'', function(event){ > alert(''hello''); > }); > }); > > > which doesn''t work....if i replace the hover for the event to be > observed with click it works.....any ideas what this problem can > be....i have no other script on the page apart fom this....i just > don''t ge it > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
HAHA LOL....thanks guys....i knew there was something not quite right.....it''s worrying because i''ve worked with normal javascript for a few years now and have used mouseover countless times...maybe it was because i''m using prototype that i got thrown?! Anyways thanks On Feb 20, 3:29 pm, Walter Lee Davis <wa...-HQgmohHLjDZWk0Htik3J/w@public.gmane.org> wrote:> The event you want is mouseover, not hover. Hover is a css pseudo- > selector. > > Walter > > On Feb 20, 2008, at 10:09 AM, elduderino wrote: > > > > > HI, > > > I have this simple code: > > > document.observe("dom:loaded", function() { > > var mensLink = $(''mens_link''); > > var womensLink = $(''womens_link''); > > mensLink.observe(''hover'', function(event){ > > alert(''hello''); > > }); > > }); > > > which doesn''t work....if i replace the hover for the event to be > > observed with click it works.....any ideas what this problem can > > be....i have no other script on the page apart fom this....i just > > don''t ge it--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---