日期:2014-05-16  浏览次数:20303 次

javascript如何获得图片右下角坐标
javascript如何获得图片右下角坐标   图片id为   tupian

------解决方案--------------------
<script language= "Javascript ">
function getIE(e){
var obj=e;
var t=e.offsetTop;
var l=e.offsetLeft;
while(e=e.offsetParent){
t+=e.offsetTop; l+=e.offsetLeft;
}
t=parseInt(t)+parseInt(e.offsetHeight)
l=parseInt(l)+parseInt(e.offsetWidth)
alert( "top= "+t+ "/nleft= "+l);
}
getIE(document.getElementById( "tupian "))
</script>