首页 > 其他 > 详细

获取图片的实际尺寸

时间:2015-04-28 16:01:14      阅读:161      评论:0      收藏:0      [点我收藏+]
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);
            //获取图片比例
        })    

 

获取图片的实际尺寸

原文:http://www.cnblogs.com/snowbaby-kang/p/4463003.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!