From 081cd980d36e2c45bf820033f9aa88f74188cf2f Mon Sep 17 00:00:00 2001 From: Travis Hegner Date: Mon, 29 Jun 2015 16:28:11 -0400 Subject: [PATCH] trying the load callback --- html/js/lazyload.js | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/html/js/lazyload.js b/html/js/lazyload.js index e3e95e75b4..6a1ec81e50 100644 --- a/html/js/lazyload.js +++ b/html/js/lazyload.js @@ -1,24 +1,27 @@ $(document).ready(function(){ - $("img.lazy").lazyload({ + $("img.lazy").load(lazyload_done).lazyload({ effect: "fadeIn", threshold: 300, - placeholder: "", - skip_invisible: false - }).removeClass("lazy").removeAttr('width').removeAttr('height'); + placeholder: "" + }); + $(document).ajaxStop(function() { - $("img.lazy").lazyload({ + $("img.lazy").load(lazyload_done).lazyload({ effect: "fadeIn", threshold: 300, - placeholder: "", - skip_invisible: false - }).removeClass("lazy").removeAttr('width').removeAttr('height'); + placeholder: "" + }); }); }); function wrap_overlib() { var ret = overlib.apply(null,arguments); - $('div#overDiv img').removeAttr('width').removeAttr('height'); + $('div#overDiv img').removeAttr('width').removeAttr('height').removeClass('lazy'); return ret; +} + +function lazyload_done() { + $(this).removeAttr('width').removeAttr('height').removeClass('lazy'); } \ No newline at end of file