From: zuber Date: Mon, 17 Aug 2009 22:09:45 +0000 (+0200) Subject: Dopracowanie leniwego doładowywania stron (problemy są w momencie, kiedy skan strony... X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/626c374dc3f412d481ebc56386ab7f6bdd05b5e9?ds=sidebyside;hp=-c Dopracowanie leniwego doładowywania stron (problemy są w momencie, kiedy skan strony jest wyższy od przygotowanej dla niego warstwy). --- 626c374dc3f412d481ebc56386ab7f6bdd05b5e9 diff --git a/project/static/js/jquery.lazyload.js b/project/static/js/jquery.lazyload.js index 25c94869..ea3de6ff 100644 --- a/project/static/js/jquery.lazyload.js +++ b/project/static/js/jquery.lazyload.js @@ -31,7 +31,13 @@ || belowViewport(container, this, settings.threshold)) { $(this).html(settings.placeholder); } else { - $(this).html(''); + $(this).html(''); + var self = this; + $('').load(function() { + if ($(this).height() > $(self).height()) { + $(self).height($(this).height()); + } + }).appendTo(this); } }) } diff --git a/project/templates/explorer/folder_images.html b/project/templates/explorer/folder_images.html index e6beb076..4104926a 100644 --- a/project/templates/explorer/folder_images.html +++ b/project/templates/explorer/folder_images.html @@ -1,5 +1,5 @@ {% for image in images %} -
+

{{ image }}

{% endfor %} \ No newline at end of file