- From: Joćo Eiras <joao.eiras@gmail.com>
- Date: Mon, 26 Mar 2007 00:46:27 +0100
- To: Yansky <thegooddale@gmail.com>
- Cc: "www-dom@w3.org" <www-dom@w3.org>
Na , Yansky <thegooddale@gmail.com> escreveu: > > Hi, I was wondering about the :hover pseudo-class in style rules and how > that translates into the DOM. Is it translated into the browser as a > Javascript-type mouseover event? Would it be possible to read the style > rules set to the hover pseudo-class via onmouseover? > > Cheers, > Yansky. mouseover/mouseout are fired if the mouse is moved either over a child of the target or another node in the document tree, so you need to check if the element to where the mouse is going is a descendant of the previous node. Like, onmouseover, check that target is a descendant of relatedTarget. Then, since :hover styles are applied dynamically, without any script intervention, you can read the computed styles for some element in the DOM, using getComputedStyle(...)
Received on Sunday, 25 March 2007 23:46:33 UTC