Pentiado / angular-lazy-img

Lightweight lazy load images plugin. Only 1kb after gziping. Pure JavaScript, only Angular as dependency.
MIT License
178 stars 66 forks source link

angular-lazy-img not working on safari browser #49

Open shravan-saini opened 5 years ago

shravan-saini commented 5 years ago

I am using angular-lazy-img with angular 1.5.8. The image lazy load is working fine on chrome but not working safari.

here is the sample img tag--- < img id="list-img-id" class="list-imgs lazy list-row-img" lazy-img="{{near.coverImage}}" alt="{{near.displayName + ' ' +near.displayNameLocation}}" style="" >

here is lazyImgConfig function---

config(['lazyImgConfigProvider', function(lazyImgConfigProvider) { setTimeout(function() { console.log('lazyImgConfigProvider',lazyImgConfigProvider); var scrollable = document.querySelector('#hawai'); lazyImgConfigProvider.setOptions({ offset: 1, // how early you want to load image (default = 100) errorClass: 'error', // in case of loading image failure what class should be added (default = null) successClass: 'success', // in case of loading image success what class should be added (default = null) onError: function(image) {}, // function fired on loading error onSuccess: function(image) {}, // function fired on loading success container: angular.element(scrollable) // if scrollable container is not $window then provide it here }); }, 1000)

}]);

please let me know whats the issue and how can i fix it.