您现在的位置是:首页 > 电脑技术查询 > web开发

javascript怎么获得图片右下角坐标

编辑:chaxungu时间:2022-10-02 23:20:03分类:web开发

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>