0

滚动到 mCustomScrollbar 或运行函数时如何获得警报

$('.section-wrap').mCustomScrollbar("scrollTo", 0, {
    scrollInertia: 1500,
    scrollEasing: "easeOut",
    callback:{
        alert()  or somefunc ();
    }       
});

function somefunc(){
    alert();
}
4

1 回答 1

0

使用onScroll或其他一些回调:

jQuery('.section-wrap').mCustomScrollbar("scrollTo", 0, {
    scrollInertia: 1500,
    scrollEasing: "easeOut",
    callbacks: {
        onScroll: function() {
            // your code
            alert('content scrolled...');
        }
    }
});
于 2015-09-05T13:27:24.783 回答