在JavaScript中,是否有可能獲取元素懸停在其上的所有元素的列表?我使用一個元素作爲遊標,並且當光標元素懸停在每個其他元素上時,我希望頁面中的其他元素加下劃線。獲取特定元素下的所有元素
<div id="cursor">|----------|<br/>|----------|<br/>>I'm a spaceship!><br/>|----------|<br/>|----------|<br/></div>
<div id="hi">Try to select this text</div>
<p>I want to automatically highlight all elements that the cursor element hovers over.</p>
<p>Here's an element.<p>
我剛剛發現了一個類似的問題,但我不確定它是否是重複的:http://stackoverflow.com/questions/4230029/jquery-javascript-collision-detection – 2013-04-20 03:50:29