What can prevent the CSS :hover
pseudo class from getting triggered, either with CSS or JavaScript?
I'm trying to debug a really tricky problem in a third party's custom calendar control. The client wants to highlight the dates when the user hovers over them--pretty standard stuff. But something is stubbornly preventing the :hover
class from working as expected.
I'm able to target the date cells with a selector and manipulate the background-color
without any issues. Adding the :hover
pseudo class to that selector doesn't work, though.
Unfortunately I can't post any code, because this is a private app that requires an account to use. There's honestly so much spagetti that I wouldn't even know what to include... The control is built in pure JS, no jQuery here, no siree. Several hundred lines of JS, plus hundreds of lines of CSS ... Not sure what's wrong with using the jQuery calendar control.
Is there a known set of things that can break :hover
? Could it be an event propagation issue, caused by returning false
from an onhover
eventhandler or something?
Any other suggestions for debugging this problem? Using the browser tools isn't very effective, because the :hover
rules don't get triggered unless I'm hovering. Catch 22 there.
EDIT: This answer seems like a possible culprit. They're definitely using some absolute positioning in the mix...
EDIT 2: Manually applying the :hover
state with Chrome's developer tools works, confirming that my selector isn't the issue. Something is preventing the :hover
state from being triggered. The calendar control is implemented as an HTML table, with each week in a row and each date in a cell. It does seem like a layering issue, but adding a high z-index
to the cells doesn't do anything.