如何得到页面显示的图片的属性如大小,尺寸大小等。

解决方案 »

  1.   


    function getFileSize(filePath){     
        var image=new Image();     
        image.dynsrc=filePath;     
        alert(image.fileSize);     

    function getImageW(id){     
        var image=document.getElementById(id);     
        alert(image.offsetWidth);     

    function getImageH(id){     
        var image=document.getElementById(id);     
        alert(image.offsetHeight);     
    }