如何在 scrollExtend 上调用函数。我需要像下面这样的代码,但它不能正常工作。如何让它发挥作用?
$(document).ready(
function() {
$('#scrollBox').scrollExtend(function() {
//alert('scroll extend working');
//functionCall();
});
}
);
但是 scrollExtend 的实际代码如下,我不知道如何调用它的函数,
jQuery('.scroll_container').scrollExtend({
'target': 'div#scroll_items',
'url': 'more_content.html',
'newElementClass': 'list_item more_content'
});
最佳答案
我会使用 JQuery 中的内置函数 onScrollBeyond。
否则在 scrollExtend 中有一个称为 beforestart 和 onSuccess 的设置,它们都是回调变量,这意味着您可以将函数放在那里
$('#scrollBox').scrollExtend({
'target': 'div#scroll_items',
'beforeStart': myFunction,
'onSuccess': mySecondFunction
});
问候
关于javascript - 在 ScrollExtend 上调用函数 - jQuery,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14353492/