Is there a simple way to locate all DOM elements that \"cover\" (that is, have within its boundaries) a pixel with X/Y coordinate pair?
I couldn't stop myself to jump on Felix Kling's answer:
var $info = $('', {
css: {
position: 'fixed',
top: '0px',
left: '0px',
opacity: 0.77,
width: '200px',
height: '200px',
backgroundColor: '#B4DA55',
border: '2px solid black'
}
}).prependTo(document.body);
$(window).bind('mousemove', function(e) {
var ele = document.elementFromPoint(e.pageX, e.pageY);
ele && $info.html('NodeType: ' + ele.nodeType + '
nodeName: ' + ele.nodeName + '
Content: ' + ele.textContent.slice(0,20));
});
updated: background-color !