Хочу потестить это:
https://github.com/darkwing/LazyLoad/
Делаю тестовую страницу:
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<script type="text/javascript" src="/LazyLoad.js"></script>
<img src="https://davidwalsh.name/dw-content/blank.gif" data-src="https://davidwalsh.name/dw-content/mexico-2009/small/102_1152.jpg" />
<!-- or -->
<img data-src="https://davidwalsh.name/dw-content/mexico-2009/small/102_1152.jpg" />
<script>
var lazyloader = new LazyLoad({
range: 200,
realSrcAttribute: "data-src",
useFade: true,
elements: 'img',
container: window
});
</script>
Не работает, что то не так подключаю?
В консоли ругается на строчки:
Uncaught ReferenceError: Class is not defined
var lazyloader = new LazyLoad({
и
Uncaught TypeError: LazyLoad is not a constructor
var LazyLoad = new Class({