I have a code that i want to execute when scroll end.
So when i scroll “div 1” i want to execute the code with “div2”. The problem is that this code have .scrollLoad and some “this” in the code. If i change “this” with “div2” the code don’t work. So when i scroll to div1 I want “this” to recognize the 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;
}
});
Becuase the javascript is decalred within the scrollload handler of #div2,
$(this)is #div2.