Wednesday 15 September 2010

jquery - Hover doesn't work but click does -


Update: Only broken on Chrome, Safari seems to work well Maybe it's something in my star

I have HTML that looks like this

  & lt; Div class = "star" & gt; & Lt; / Div & gt; & Lt; Div class = "star" & gt; & Lt; / Div & gt; & Lt; Div class = "star" & gt; & Lt; / Div & gt; & Lt; Div class = "star" & gt; & Lt; / Div & gt; & Lt; Div class = "star" & gt; & Lt; / Div & gt;   

I want to trigger an event on the hut. So I have a code that looks like this:

  $ (document) .ready (function () {$ ('.star'). Each (function () {$ (this) . (Function () {console.log ('hover');});});});   

I also tried:

  $ (".tar"). Hover (function () {console.log ("hover trigger");});   

I have tried many variations of this code without success, this hover code works only when I click on the star , but when I Please do not hover Please help because I've really lost why it is not working. When I try this on JS Friedal, it works, but my page has not been set in different ways. Why would it work on click, but not on hover, when the trigger hover?

I had a single problem goes outwards I first tried to simulate the touch screen of chrome Was using developer tools, which got spoiled from the hover event.

No comments:

Post a Comment