Lazy Loading doesnt display my images

我们两清 提交于 2019-12-11 08:32:29

问题


I have heavy content images. Thats why I decided to use lazy load: http://www.appelsiini.net/projects/lazyload

My page is this one: http://www.mysecretathens.gr/kulte_test/osterman.html

I followed all the instructions that are required but dont understand why the first images that I wanted to test the lazy load function dont display

In my head section is this:

   <script src="jquery.js" type="text/javascript"></script>
<script src="lazyload.js" type="text/javascript"></script>

the images:

 <img class="lazy" src="grey.gif" data-original="osterman/ost21.jpg" width="900" height="602" >

and JS code

  <script type="text/javascript">

 $("img.lazy").lazyload();

</script>

Why is only the grey.gif showing up and not the actual image? Any ideas? Do I have the wrong jquery files? Thanks in advance


回答1:


Errors in chrome debugger:

Uncaught SyntaxError: Unexpected identifier jquery.js:9598

Uncaught SyntaxError: Unexpected identifier lazyload.js:228

Uncaught ReferenceError: $ is not defined osterman.html:205




回答2:


Your JS does seem to throw an error. On the bottom of your jquery.js file seems to be invalid code:

...
})( window );
Window size: x 
Viewport size: x

The last two lines cause the error and prevent any further JS execution.



来源:https://stackoverflow.com/questions/15774116/lazy-loading-doesnt-display-my-images

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!