JS图片加载时获取图片宽高信息

 var height = 0;
                        var img = new Image();
                        img.src = node.find("img[class='img1_1']").attr("src");
                        if (img.complete) {
                            height = img.height;
                        } else {
                            img.onload = function () {
                                height = img.height;
                                                           }
                        }

 

onerror
multiple

 

posted @ 2013-11-02 14:06  xyzhuzhou  阅读(296)  评论(0编辑  收藏  举报