@19h47/slider 中文文档教程

发布于 4年前 浏览 26 项目主页 更新于 3年前

@19h47/slider

Usage

import Slider from @19h47/slider

const $slider = document.querySelector('[role=slider]');
const slider = new Slider($slider);

slider.init();

Keyboard Support

KeyFunction
Right ArrowIncreases slider value one step.
Up ArrowIncreases slider value one step.
Left ArrowDecreases slider value one step.
Down ArrowDecreases slider value one step.
Page UpIncreases slider value multiple steps.
In this slider, jumps ten steps.
Page DownDecreases slider value multiple steps.
In this slider, jumps ten steps.
HomeSets slider to its minimum value.
EndSets slider to its maximum value.

Event

EventArgumentsDescription
Slider.changeeventObject containing now value.
import Slider from @19h47/slider

const $slider = document.querySelector('[role=slider]');
const slider = new Slider($slider);

slider.init();

slider.on('Slider.change', ({ now ) => {
    console.log(now);
});

Acknowledgments

@19h47/slider

Usage

import Slider from @19h47/slider

const $slider = document.querySelector('[role=slider]');
const slider = new Slider($slider);

slider.init();

Keyboard Support

KeyFunction
Right ArrowIncreases slider value one step.
Up ArrowIncreases slider value one step.
Left ArrowDecreases slider value one step.
Down ArrowDecreases slider value one step.
Page UpIncreases slider value multiple steps.
In this slider, jumps ten steps.
Page DownDecreases slider value multiple steps.
In this slider, jumps ten steps.
HomeSets slider to its minimum value.
EndSets slider to its maximum value.

Event

EventArgumentsDescription
Slider.changeeventObject containing now value.
import Slider from @19h47/slider

const $slider = document.querySelector('[role=slider]');
const slider = new Slider($slider);

slider.init();

slider.on('Slider.change', ({ now ) => {
    console.log(now);
});

Acknowledgments

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文