jquery lazy load content in div

后端 未结 3 942
情深已故
情深已故 2021-01-02 19:39

I want to load the content in div.I got many jquery scoll plugins but all are they for whole page load.I want to load content in existing div when scroll reaches at bottom o

3条回答
  •  感情败类
    2021-01-02 20:22

    You can do something like this using JQuery and this lazyload plugin.

    Your div:

    Use beforeLoad callback:

    jQuery(function($) {
        $("div[url]").lazy({
            beforeLoad: function (element) {
                element.load(element.attr("url"));
            }
        });
    });
    

提交回复
热议问题