Webflow sync, pageviews & more.
NEW
Answers

How can I set the default starting slide to slide 2 in a Webflow slider without sharing the read-only link?

To set the default starting slide to slide 2 in a Webflow slider without sharing the read-only link, you can use some custom code.

1. Firstly, go to the Settings pane of the Slider element. Under the "Class" section, give your slider element a unique class name. For example, let's use "my-slider".

2. Next, navigate to the custom code section of your project by clicking on the gear icon in the top-right corner and selecting the "Custom Code" tab.

3. In the "Before " section, paste the following code:

```javascript

```

4. Save the changes to your custom code and publish your site.

With this code, when the page loads, it waits for the content to finish loading and then finds the slider with the class name "my-slider". If found, it sets the data attribute `currentSlide` to "2" (corresponding to the second slide in the slider). Finally, it triggers the `slideChange` event to update the displayed slide.

Please note that this solution assumes you have already created your Slider component with multiple slides, and you have referenced the correct class name in the code. Make sure to replace "my-slider" with the actual class name of your slider.

By implementing this custom code, you should be able to set the default starting slide to slide 2 in your Webflow slider without sharing the read-only link.

Rate this answer

Other Webflow Questions