FullScreen Full-Screen Slider Plugin for Mobile Devices
Add-ons

Plugin description: FullScreen is a full-screen slider plugin featuring smooth animation transitions and support for touch-based switching on mobile devices.
Usage
Create an instance and pass the wrapper element (e.g., document) and the 2D parsing object as parameters, as shown below.
1 2 3 4 5 6 7 | const fsSlider = new FullscreenSlider( document, { x: window.innerWidth, y: window.innerHeight }); |
Bind the resize event. You should run the reset method before running the resize method to properly set the resolution of the section elements. Additionally, you should pass an object containing the window dimensions to the resize method to resize these sections to full-screen dimensions.
1 2 3 4 5 6 7 8 9 | window.addEventListener('resize', () => { fsSlider.reset(); fsSlider.resize( { x: window.innerWidth, y: window.innerHeight } );}); |
To start the animation, call the start method.
1 | fsSlider.start() |
评论