获取图片的实际尺寸

var img = $("#j-preview-img");
        var relratio, twidth, theight;
        $("<img/>").attr("src", $(img).attr("src")).load(function() {
            twidth = this.width;
            theight = this.height;
            relratio = (twidth/theight).toFixed(2);
            //获取图片比例
        })    

 

posted @ 2015-04-28 14:48  雪宝贝_kang  阅读(171)  评论(0编辑  收藏  举报