diff --git a/resources/artbox-lazy.js b/resources/artbox-lazy.js index 63dea93..b654bfb 100644 --- a/resources/artbox-lazy.js +++ b/resources/artbox-lazy.js @@ -9,23 +9,23 @@ $(function() { function lazyThreshold() { $.each($('img.artbox-lazy-threshold'), function(index, value) { var threshold = 200; - var attribute = $(value).attr('data-threshold'); + var attribute = $(value).data('threshold'); if(attribute) { threshold = attribute; } - this.lazyload({ + $(value).lazyload({ threshold: threshold }); }); } function lazyEvent() { $.each($('img.artbox-lazy-event'), function(index, value) { - var event = 'click'; - var attribute = $(value).attr('data-event'); + var event = 'lazy.artbox'; + var attribute = $(value).data('event'); if(attribute) { event = attribute; } - this.lazyload({ + $(value).lazyload({ event: event }); }); @@ -33,11 +33,11 @@ function lazyEvent() { function lazyEffect() { $.each($('img.artbox-lazy-effect'), function(index, value) { var effect = 'fadeIn'; - var attribute = $(value).attr('data-effect'); + var attribute = $(value).data('effect'); if(attribute) { effect = attribute; } - this.lazyload({ + $(value).lazyload({ effect: effect }); }); -- libgit2 0.21.4