|| 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);
}
})
}
{% for image in images %}
- <div class="image-box" src="{{ image }}" style="width: 460px; height: 460px; margin: 5px; background-color: gray">
+ <div class="image-box" src="{{ image }}" style="width: 480px; height: 640px; border:1px solid #DDD; margin: 5px">
<p>{{ image }}</p>
</div>
{% endfor %}
\ No newline at end of file