No dependencies
DX Slider
Responsive, swipeable and configurable for real projects.
Drag the slide, use the controls, or press the arrow keys.
More setups
Examples
The same script with different options. View the page source to copy any of them.
Fade, hands-free
A crossfade that runs on its own: effect: 'fade' with autoplay: 3500. Hovering, focusing or hiding the tab pauses playback, and the play button stays in sync.
Auto height
With autoHeight: true the viewport animates to the height of the active slide, so short and long content can share one slider. loop: false gives the track hard ends and disables the arrows there.
Drag only, no chrome
All controls removed: navigation, pagination and keyboard are off, leaving pure drag and swipe with loop: false. Useful inside card layouts where arrows would be noise.
Remote control
Any element on the page can drive a slider through its public API. These buttons live outside the component and call methods on the instance; the readout comes from getState().
DOM events
Every change dispatches bubbling DOM events on the root element, so other scripts can react without callbacks. This log listens for dxsliderbeforechange and dxsliderchange.
- Waiting for the first event…