0

我的代码:

(function($){
    $.fn.extend({
        popupbox: function(options) {

            //Settings list and the default values
            var defaults = {
                photo_url : "",
                photo_id  : ""
            };

            var options = $.extend(defaults, options);

            return this.each(function() {
                var o = options;

                //Assign current element to variable
                var obj = $(this);

                var photo_pic = $('#photo_box_img');

                photo_pic.attr("src", o.photo_url);

                photo_pic.load(function() {

                    var pic_width = photo_pic.width();
                    var pic_height = photo_pic.width();

                    console.log(pic_width);

                }


            });

        }
    });
})(jQuery);

我第一次click使用上面的image按钮click() function返回0next time它......为什么会这样?showsproper width

4

0 回答 0