我有一个要在滚动结束时执行的代码。所以当我滚动“div 1”时,我想用“div2”执行代码。问题是这段代码在代码中有 .scrollLoad 和一些“this”。如果我用“div2”更改“this”,则代码不起作用。因此,当我滚动到 div1 时,我希望“this”能够识别 div2。
$( '#div2' ).scrollLoad({
            url : 'load_more_categ.php', //your ajax file to be loaded when scroll breaks ScrollAfterHeight
            type: 'POST',
            data : '',
            start : function() {
                $('<div class="loading"><img src="bigLoader.gif"/></div>').appendTo(this);
            // you can add your effect before loading data
            },
            ScrollAfterHeight : 95,         //this is the height in percentage after which ajax stars
            onload : function( data ) {
                $(this).append( data );
                $('.loading').remove();
            }, // this event fires on ajax success
            continueWhile : function( resp ) {
                if( $(this).children('li').length >= 100 ) { // stops when number of 'li' reaches 100
                    return false;
                }
                return true; 
            }
        });