0
var slideAmount = $(window).width() > 1200 ? 300 : 10;
    $(".selector").mCustomScrollbar({
        axis:"x",
        keyboard:{ enable: false },
        snapAmount: slideAmount,
    });

How i can update snapAmount in this case? For an example i want it to be 300px if window's width is over 1200px and 10px, if its under while resizing. I've tried with onUpdate callback, but it doesnt work and i've read the documentation and tried almost everything, but couldn't find a solution. Please help.

Vladimir-Manov
  • 61
  • 1
  • 1
  • 7

1 Answers1

0

So i found the solution in the comments on their website posted 5 years ago.

You need to add this:

$(".selector").data("mCS").opt.snapAmount=slideAmount;

You put that on a callback of your choice and you update the setting you choose, in this example snapAmount.

Vladimir-Manov
  • 61
  • 1
  • 1
  • 7