Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible to adjust speed? #112

Closed
jesperlandberg opened this issue Oct 26, 2017 · 1 comment
Closed

Possible to adjust speed? #112

jesperlandberg opened this issue Oct 26, 2017 · 1 comment
Labels

Comments

@jesperlandberg
Copy link

Hi,
Thanks for a good plugin.

Is it possible to adjust the speed of the scrolling also? not only damping.

@idiotWu
Copy link
Owner

idiotWu commented Oct 26, 2017

You can use plugin system to do this:

class ScaleSpeedPlugin {
  static pluginName = 'scaleSpeed';

  static defaultOptions = {
    speed: 1,
  };

  transformDelta(delta) {
    const { speed } = this.options;

    return {
      x: delta.x * speed,
      y: delta.y * speed,
    };
  }
}

Scrollbar.use(ScalePlugin);

Scrollbar.init(elem, {
  plugins: {
    scaleSpeed: {
      speed: 10,
    },
  },
});

@idiotWu idiotWu closed this as completed Oct 27, 2017
@idiotWu idiotWu mentioned this issue Apr 27, 2021
Repository owner locked and limited conversation to collaborators Jun 10, 2021

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Projects
None yet
Development

No branches or pull requests

2 participants