javascript - Uncaught TypeError: undefined is not a function on using jQuery.lazy() - Stack Overflow

I'm trying to use the jQuery's delayed image loading plugin to lazy load my images. While try

I'm trying to use the jQuery's delayed image loading plugin to lazy load my images. While trying to do so I'm getting the error Uncaught TypeError: undefined is not a function on the 2nd line of my code.

Here is my JS code

jQuery(document).ready(function() {
    jQuery("img.lazy").lazy({
        effect: "fadeIn",
        effectTime: 1500
    });
});

This script is placed at the bottom of my page in a JS file along with some of my other scripts.

I have the following scripts in my <head> and I've verified that the files are indeed linked properly.

<script type="text/javascript" src="/static/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-ui.js"></script>

I have tried most of the solutions given to this problem on SO but I haven't had any success.

I'm trying to use the jQuery's delayed image loading plugin to lazy load my images. While trying to do so I'm getting the error Uncaught TypeError: undefined is not a function on the 2nd line of my code.

Here is my JS code

jQuery(document).ready(function() {
    jQuery("img.lazy").lazy({
        effect: "fadeIn",
        effectTime: 1500
    });
});

This script is placed at the bottom of my page in a JS file along with some of my other scripts.

I have the following scripts in my <head> and I've verified that the files are indeed linked properly.

<script type="text/javascript" src="/static/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="/static/js/jquery-ui.js"></script>

I have tried most of the solutions given to this problem on SO but I haven't had any success.

Share Improve this question asked Aug 13, 2014 at 18:53 Yin YangYin Yang 1,8063 gold badges28 silver badges48 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 3

jQuery lazy is a separate plugin, and is not available part of either jquery, or jquery-ui

You need to download and add a reference along with the rest of the jquery libraries

<script type="text/javascript" src="/static/js/jquery.lazy.min.js"></script>

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745473971a4629259.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信