Zamiana sztywnego dowiÄ…zania w skrypcie w file_xml.html na URL.
[redakcja.git] / project / static / js / jquery.lazyload.js
index 25c9486..ea3de6f 100644 (file)
                         || belowViewport(container, this, settings.threshold)) {
                         $(this).html(settings.placeholder);
                     } else {
                         || belowViewport(container, this, settings.threshold)) {
                         $(this).html(settings.placeholder);
                     } else {
-                        $(this).html('<img src="' + $(this).attr('src') + '" width="' + $(this).width() + '" />');
+                        $(this).html('');
+                        var self = this;
+                        $('<img src="' + $(this).attr('src') + '" width="' + $(this).width() + '" />').load(function() {
+                            if ($(this).height() > $(self).height()) {
+                                $(self).height($(this).height());
+                            }
+                        }).appendTo(this);
                     }
                 })
             }
                     }
                 })
             }