MCustomScrollbar "scrollTo" does not work

I use the basic setup for mCustomScrollbar, which works fine when I call the following: -

jQuery("#mcs_container").mCustomScrollbar("scrollTo","top");

Nothing happens. There is no error in firebug, it does nothing. Has anyone experienced this before, or does anyone know why this can happen?

thank!

+5
source share
6 answers

MCustomScrollbar does not provide scroll functions to the top of the page. However, it does support scrolling to a specific element in HTML.

For example, if I have an element with the identifier "logout" that is at the top of the page, and I need to scroll up, then write

$("#mcs_container").mCustomScrollbar("scrollTo", "#logout");

I hope you find this helpful.

Hooray!

+9
source

,

+1
setTimeout( function () {
   $("#mcs_container").mCustomScrollbar('scrollTo','last');
 }, 100);

-

+1

mCustomScrollbar..... ...

$ ("scroller-back"). MCustomScrollbar ("scrollTo", JQuery ("# ​​mcs_container")) ;.

0
source

I use it that way, it works!

// set scrollbar
$('.scroll-y').mCustomScrollbar({
  theme: 'minimal-dark'
});

// then set scrollTo
$('.scroll-y').mCustomScrollbar('scrollTo', 'bottom');
0
source

After searches for the day. Here is what I got:

Tested and working (2019): $('.demo-yx').mCustomScrollbar('scrollTo',['top',null]);

On this link . Hooray!

0
source

All Articles