阅读背景:

重置一个功能,或者可能停止某些功能并重新启动它?

来源:互联网 

I have this code:

我有这个代码:

$(document).ready(function() {  
    var number = 10;
    var offset = 10;
    var page_number = 2;    

    /* Bind the scroll function to an event */
    $(window).bind('scroll', function(e) {

        /* If the scroll height plus the window height is 
           more than the document height minus 10, continue */
        if($(window).scrollTop() + $(window).height() > 
           $(document).height() - 10) {         

            /* Quick message so you know more stuff is loading */
            $('.loading-more').html('Keep scrolling for more posts to load..');     

            $.post('<?php bloginfo('siteurl') ?>/wp-admin/admin-ajax.php', {
                action: 'and_action',
                off: offset+number,
                pagenumber: page_number - 1
                }, function(data) {
                    offset = offset+number;                         
                    $('.empty-div').append('<p><strong>Page '+page_number+'</strong></p><br />'+data);
                    page_number += 1;               
                    $(this).unbind(e);                                          
            }); 
        }       
    });
});
$(document).ready



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: