日期:2014-05-16 浏览次数:20953 次
<div id="dvImgID"></div>
<img id="img1" src="xx.jpg" />
<img id="img2" src="xx.jpg" />
<img id="img3" src="xx.jpg" />
<img id="img4" src="xx.jpg" />
<script>
document.onmousemove = function (e) {
e = e
------解决方案--------------------
window.event;
var o = e.target
------解决方案--------------------
e.srcElement;
if (o.tagName == 'IMG') document.getElementById('dvImgID').innerHTML = o.id;
}
</script>