回答:
document.elementFromPoint(x, y);
http://dev.w3.org/csswg/cssom-view/#dom-document-elementfrompoint
http://msdn.microsoft.com/en-us/library/ms536417%28VS.85%29.aspx
https://developer.mozilla.org/en/DOM/document.elementFromPoint
document.elementsFromPoint
要素が重複している場合には-にも。
document.elementsFromPoint
実験的ではありますが、最近のWebkitおよびGecko対応ブラウザーで使用できます。MDNを参照してください。
elementFromPoint(x, y)
ビューポートの座標x、yに要素を返すネイティブJavaScript メソッドを使用できます。
elementFromPoint w3cドラフトを参照してください
そして、コードサンプル:
function changeColor(newColor) {
// Get the element placed at coords (2, 2)
var elem = document.elementFromPoint(2, 2);
// Set the foreground color to the element
elem.style.color = newColor;
}
<p id="para1">Change this text color using the following buttons.</p>
<button onclick="changeColor('blue');">Blue</button>
<button onclick="changeColor('red');">Red</button>
を使用setInterval()
して要素のホバーイベントを継続的に確認できますが、お勧めしません.hover(...)
。代わりにとcss を使用して、アプリケーションのパフォーマンスを向上させてください。