To add pagination and arrows to the slider/carousel in Webflow using the Swiper integration, you can follow these steps:
1. Install the Swiper.js library: First, make sure you have the Swiper.js library installed in your Webflow project. You can do this by going to the Project Settings > Integrations > Add Javascript, and include the Swiper CDN link in the Head Code section.
2. Create a Slider: Add a Slider component to your Webflow project. This can be found in the Add Panel under Components. Customize the design and layout of your slider as per your preferences.
3. Add Pagination and Navigation elements: Inside the Slider component, add two Div blocks to serve as your Pagination and Navigation elements. Give them appropriate class names, like "swiper-pagination" and "swiper-navigation".
4. Custom code: Go to the Page Settings > Custom Code and add the following code in the Footer Code section:
```javascript
```
Be sure to replace '.slider' with the correct class name of your Slider component.
5. Modify Breakpoints: To modify the breakpoints to display only one slide on mobile, you need to adjust the Swiper configuration options. Add the 'breakpoints' property to the Swiper initialization code, like this:
```javascript
const mySwiper = new Swiper('.slider', {
// Add pagination and navigation options...
breakpoints: {
// Below 640px width, display only one slide
640: {
slidesPerView: 1,
},
// Modify or add more breakpoints as needed
},
});
```
Make sure to adjust the breakpoints and slidesPerView values according to your design requirements.
Regarding the issue you mentioned with the script code not working, please ensure that you have correctly added the Swiper.js library and that there are no syntax errors or conflicts with other JavaScript code on your page. Checking the browser console for any error messages can also be helpful in troubleshooting the issue.
If you are facing difficulties, feel free to share the code and describe the issue you're encountering in more detail, and I'll be glad to assist you further.