I'm using jQuery mCustomScrollbar
on my website.
I'm using 2 functions, using the same onClick
action:
$('body').on('click', '.infos_open', function () {
First I want my custom content to scroll back:
$(".mCustomScrollbar").mCustomScrollbar("scrollTo",0);
And once it's done, another function (as an example):
$('.infos_fixed').removeClass('fixed');
But I can't figure out how to use a callback to do this.
here is what I've tried:
$('body').on('click', '.infos_open', function () {
$(".mCustomScrollbar").mCustomScrollbar("scrollTo",0, function(){
$('.infos_fixed').removeClass('fixed');
});
});
And here is another solution I tried, which is not working:
$('body').on('click', '.infos_open', function () {
$(".mCustomScrollbar").mCustomScrollbar("scrollTo",0, {
scrollInertia: 3000,
callbacks: {
onScroll: function(){
$('.infos_fixed').removeClass('fixed');
}
}
});
});
Can't find more information about this, I need to keep the exact syntax "$('body').on('click', '.infos_open', function () {"
Can anybody help with this?