Interactive playground to experiment with DriftSlider's physics-based touch parameters.
互動式遊樂場,實驗 DriftSlider 的物理引擎觸控參數。
Drag the slider to feel the difference — physics only affects touch/drag interactions.
var DS = DriftSlider;
var slider;
function createSlider() {
if (slider) slider.destroy();
slider = new DS.DriftSlider('.drift-slider', {
modules: [DS.Navigation, DS.Pagination, DS.A11y],
slidesPerView: 1,
spaceBetween: 20,
grabCursor: true,
speed: 400,
physics: {
friction: 0.92, // 0–1, higher = more momentum
attraction: 0.025, // snap pull force, higher = snappier
bounceRate: 0.5, // edge bounce intensity
},
});
}
createSlider();