To have two slides work concurrently on the same page in Webflow using Splidejs without any malfunctions or issues, you can follow these steps:
Step 1: Set up your structure
Create two separate slide containers, each with their own unique class name. For example, you can have "slide-container-1" and "slide-container-2".
Step 2: Add Splidejs to your project
You can add Splidejs to your project by including the Splide CDN link in your project settings or by manually adding the Splide library to your custom code. Make sure you have the latest version of Splidejs.
Step 3: Initialize the Sliders
In your custom code, after the Splide library is loaded, initialize the two slide containers as separate sliders using their unique class names. For example:
```javascript
document.addEventListener('DOMContentLoaded', function() {
new Splide('.slide-container-1').mount();
new Splide('.slide-container-2').mount();
});
```
Step 4: Configure options
You can configure various options for each slider to customize their behavior. For example, you can set the number of visible slides, autoplay, navigation arrows, and more. Refer to the Splidejs documentation for a full list of available options.
Step 5: Style and customize
Use CSS to style both slide containers and their respective slides. You can apply different styling, such as different colors, sizes, or positioning, to differentiate the two sliders.
Step 6: Test and troubleshoot
Preview your page and test the functionality of both sliders. Make sure they work independently without interfering with each other. If you encounter any issues or malfunctions, check the console for any error messages and refer to the Splidejs documentation or community for troubleshooting guides.
By following these steps, you should be able to have two slides work concurrently on the same page in Webflow using Splidejs without encountering any malfunctions or issues. Remember to keep your code organized and make use of class names or IDs to target specific elements for styling or interaction.