><!DOCTYPE html> ><html> > <head> > <script type="text/javascript"> >function checkMouseInOtherDiv(out, otherDiv) { > out.innerHTML = "out"; > // check to see if the other div is hovered > var oDiv = document.getElementById(otherDiv); > // go through the hover tree > var hoverTree = document.querySelectorAll(":hover"); > var otherHovered = false; > for (var index = 0; index < hoverTree.length; index++) { > hover = hoverTree[index]; > console.log("hover on " + hover.tagName + ": " + hover.id); > if (hover.id === otherDiv) { > // the mouse is over the other div, do something... > out.style.backgroundColor = "red"; > otherHovered = true; > break; > } > } > console.log("is " + otherDiv + " hovered? " + otherHovered); >} > </script> > </head> > <body> > <div id="one" style="position: absolute; top: 0; left: 0; width: 100px; height: 100px; background-color: #ccc" onmouseout="checkMouseInOtherDiv(this, 'two')"> > </div> > <div id="two" style="position: absolute; top: 100px; left: 0; width: 100px; height: 100px; background-color: #cc0" onmouseout="checkMouseInOtherDiv(this, 'one')"> > </div> > </body> ></html> >Thanks, this is a good approach. I checked that out yesterday but was unable to make something work.