well-waterfall 1.4.2 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +184 -108
- package/dist/attributes.js +239 -250
- package/dist/attributes.js.map +1 -1
- package/dist/lib/attributes.d.ts +42 -50
- package/dist/lib/elements.d.ts +0 -3
- package/dist/modules/accessibility.d.ts +1 -1
- package/dist/well-waterfall.es.js +2104 -2068
- package/dist/well-waterfall.es.js.map +1 -1
- package/dist/well-waterfall.umd.js +3 -3
- package/dist/well-waterfall.umd.js.map +1 -1
- package/package.json +5 -3
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ Waterfall is a free-forever JavaScript library for Webflow that lets you build [
|
|
|
9
9
|
3. **Full Documentation.** Every attribute is listed below, and each setting is explained directly in the Wellspring App.
|
|
10
10
|
4. **Turn Swipers into Components.** After creating a swiper, you can turn it into a Webflow component for reuse.
|
|
11
11
|
|
|
12
|
-
Current version: **v<!-- version -->1.
|
|
12
|
+
Current version: **v<!-- version -->1.5.0<!-- /version -->** · Bundled SwiperJS: **<!-- swiper-version -->14.4.0<!-- /swiper-version -->**
|
|
13
13
|
|
|
14
14
|
## Table of contents
|
|
15
15
|
|
|
@@ -57,7 +57,7 @@ Current version: **v<!-- version -->1.4.2<!-- /version -->** · Bundled SwiperJS
|
|
|
57
57
|
|
|
58
58
|
## Dependencies
|
|
59
59
|
|
|
60
|
-
Waterfall bundles SwiperJS <!-- swiper-version -->14.
|
|
60
|
+
Waterfall bundles SwiperJS <!-- swiper-version -->14.4.0<!-- /swiper-version --> (JavaScript and CSS) directly. If you already load SwiperJS on your site, you can remove it and just use Waterfall.
|
|
61
61
|
|
|
62
62
|
## Installation
|
|
63
63
|
|
|
@@ -66,7 +66,7 @@ Use the Wellspring App to install the code onto your site. If you are installing
|
|
|
66
66
|
**Specific Version (Stable - Recommended)**
|
|
67
67
|
|
|
68
68
|
```html
|
|
69
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/well-waterfall@1.
|
|
69
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/well-waterfall@1.5.0"></script>
|
|
70
70
|
```
|
|
71
71
|
|
|
72
72
|
**Latest Version**
|
|
@@ -116,7 +116,7 @@ Waterfall uses the standard SwiperJS markup with an added wrapper element that c
|
|
|
116
116
|
<div waterfall-el="pagination"></div>
|
|
117
117
|
<button waterfall-el="navigation-prev">Prev</button>
|
|
118
118
|
<button waterfall-el="navigation-next">Next</button>
|
|
119
|
-
<div waterfall-el="scrollbar"
|
|
119
|
+
<div waterfall-el="scrollbar"></div>
|
|
120
120
|
</div>
|
|
121
121
|
```
|
|
122
122
|
|
|
@@ -127,7 +127,7 @@ Waterfalls initialize on `DOMContentLoaded`.
|
|
|
127
127
|
## How Attributes Work
|
|
128
128
|
|
|
129
129
|
- **Placement.** Unless noted otherwise, attributes go on the `[waterfall]` wrapper element.
|
|
130
|
-
- **Naming.**
|
|
130
|
+
- **Naming.** Every attribute is `waterfall-` plus its SwiperJS parameter in kebab-case, with no exceptions. Example: `direction` → `waterfall-direction`. Parameters inside an object always keep the group name: `freeMode.enabled` → `waterfall-free-mode-enabled`, `coverflowEffect.depth` → `waterfall-coverflow-effect-depth`, `autoplay.delay` → `waterfall-autoplay-delay`. So if you know the Swiper parameter, you know the attribute. Attributes that have no Swiper equivalent (breakpoints, slide manipulation, callbacks, the autoplay control) are listed in their own sections below.
|
|
131
131
|
- **Value types.**
|
|
132
132
|
- `boolean`: the literal text `true` or `false`. Any other value is ignored.
|
|
133
133
|
- `number`: a plain number without units (`24`, not `24px`).
|
|
@@ -141,36 +141,42 @@ The attribute names are also exported as constants from `src/lib/attributes.ts`
|
|
|
141
141
|
|
|
142
142
|
### Core
|
|
143
143
|
|
|
144
|
+
<!-- reference:core:0 -->
|
|
144
145
|
| Attribute | Swiper option | Values | Default | Description |
|
|
145
146
|
| ------------------------- | -------------- | ------- | ------------ | ----------------------------------------------------------------------------------------------------------------------- |
|
|
146
147
|
| `waterfall` | — | string | _(required)_ | Unique name for this slider. Marks the element as a Waterfall. |
|
|
147
148
|
| `waterfall-debug-mode` | — | boolean | `false` | Logs the generated config and initialization details to the console. |
|
|
148
149
|
| `waterfall-initial-slide` | `initialSlide` | number | `0` | Index of the slide to show first. |
|
|
149
150
|
| `waterfall-nested` | `nested` | boolean | `false` | Set to `true` on a Swiper nested inside another Swiper with the same direction, so touch events are captured correctly. |
|
|
151
|
+
<!-- /reference:core:0 -->
|
|
150
152
|
|
|
151
153
|
### Layout
|
|
152
154
|
|
|
153
|
-
|
|
154
|
-
|
|
|
155
|
-
|
|
|
156
|
-
| `waterfall-
|
|
157
|
-
| `waterfall-slides-per-
|
|
158
|
-
| `waterfall-slides-per-group
|
|
159
|
-
| `waterfall-slides-per-group-
|
|
160
|
-
| `waterfall-
|
|
161
|
-
| `waterfall-
|
|
162
|
-
| `waterfall-
|
|
163
|
-
| `waterfall-
|
|
164
|
-
| `waterfall-
|
|
165
|
-
| `waterfall-
|
|
166
|
-
| `waterfall-slides-offset-
|
|
167
|
-
| `waterfall-
|
|
168
|
-
| `waterfall-
|
|
155
|
+
<!-- reference:layout:0 -->
|
|
156
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
157
|
+
| -------------------------------------- | -------------------------- | -------------------------- | ------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
158
|
+
| `waterfall-direction` | `direction` | `horizontal` \| `vertical` | `horizontal` | Slide direction. |
|
|
159
|
+
| `waterfall-slides-per-view` | `slidesPerView` | number \| `auto` | `1` | Number of slides visible at once. Decimals like `1.5` show partial slides; `auto` uses each slide's CSS width. |
|
|
160
|
+
| `waterfall-slides-per-group` | `slidesPerGroup` | number | `1` | Number of slides to advance per navigation step. |
|
|
161
|
+
| `waterfall-slides-per-group-skip` | `slidesPerGroupSkip` | number | `0` | Number of initial slides that advance one at a time before grouping starts. |
|
|
162
|
+
| `waterfall-slides-per-group-auto` | `slidesPerGroupAuto` | boolean | `false` | With `slidesPerView: auto`, advances by the number of slides currently visible. |
|
|
163
|
+
| `waterfall-space-between` | `spaceBetween` | number (px) | `0` | Gap between slides. |
|
|
164
|
+
| `waterfall-centered-slides` | `centeredSlides` | boolean | `false` | Centers the active slide instead of aligning it to the left or top. |
|
|
165
|
+
| `waterfall-center-insufficient-slides` | `centerInsufficientSlides` | boolean | `false` | Centers the slides when there are fewer than `slidesPerView`. |
|
|
166
|
+
| `waterfall-normalize-slide-index` | `normalizeSlideIndex` | boolean | `true` | Normalizes the active slide index when using `slidesPerGroup`. |
|
|
167
|
+
| `waterfall-auto-height` | `autoHeight` | boolean | `false` | Resizes the slider height to match the active slide. |
|
|
168
|
+
| `waterfall-slides-offset-before` | `slidesOffsetBefore` | number (px) | `0` | Extra space before the first slide. |
|
|
169
|
+
| `waterfall-slides-offset-after` | `slidesOffsetAfter` | number (px) | `0` | Extra space after the last slide. |
|
|
170
|
+
| `waterfall-width` | `width` | number (px) | — | Forces a slider width. Useful only when the slider is hidden on init. |
|
|
171
|
+
| `waterfall-height` | `height` | number (px) | — | Forces a slider height. Useful only when the slider is hidden on init. |
|
|
172
|
+
| `waterfall-centered-slides-bounds` | `centeredSlidesBounds` | boolean | `false` | Centers the active slide without leaving gaps at the start and end. Requires `waterfall-centered-slides="true"`; not intended for use with loop or pagination. |
|
|
173
|
+
<!-- /reference:layout:0 -->
|
|
169
174
|
|
|
170
175
|
### Responsive Breakpoints
|
|
171
176
|
|
|
172
177
|
Breakpoints match Webflow's breakpoints and cascade the same way Webflow styles do: outward from Desktop. A value set on Tablet also applies to Mobile Landscape and Mobile Portrait unless they override it, and a value set on Desktop also applies to 1280px and 1440px. Anywhere no breakpoint value applies, the base attribute (e.g. `waterfall-slides-per-view`) is used.
|
|
173
178
|
|
|
179
|
+
<!-- reference:responsive-breakpoints:0 -->
|
|
174
180
|
| Suffix | Webflow breakpoint | Applies to | Falls back to |
|
|
175
181
|
| ---------------- | ------------------ | --------------- | ---------------------------------- |
|
|
176
182
|
| `-mobile` | Mobile portrait | 479px and below | `-mobile-large`, `-tablet`, base |
|
|
@@ -179,7 +185,9 @@ Breakpoints match Webflow's breakpoints and cascade the same way Webflow styles
|
|
|
179
185
|
| `-desktop` | Desktop | 992px and up | base |
|
|
180
186
|
| `-desktop-small` | 1280px | 1280px and up | `-desktop`, base |
|
|
181
187
|
| `-desktop-large` | 1440px | 1440px and up | `-desktop-small`, `-desktop`, base |
|
|
188
|
+
<!-- /reference:responsive-breakpoints:0 -->
|
|
182
189
|
|
|
190
|
+
<!-- reference:responsive-breakpoints:1 -->
|
|
183
191
|
| Attribute pattern | Swiper option | Values | Description |
|
|
184
192
|
| ----------------------------------------- | ----------------- | ----------------------- | ------------------------------------------------------------------------------------------------- |
|
|
185
193
|
| `waterfall-slides-per-view-{breakpoint}` | `slidesPerView` | number | Slides visible at this breakpoint, or `auto`. |
|
|
@@ -187,45 +195,55 @@ Breakpoints match Webflow's breakpoints and cascade the same way Webflow styles
|
|
|
187
195
|
| `waterfall-space-between-{breakpoint}` | `spaceBetween` | number (px) | Gap between slides at this breakpoint. |
|
|
188
196
|
| `waterfall-centered-slides-{breakpoint}` | `centeredSlides` | boolean | Centers the active slide at this breakpoint. |
|
|
189
197
|
| `waterfall-breakpoints-base` | `breakpointsBase` | `window` \| `container` | Measures breakpoints against the window width (default `window`) or the slider container's width. |
|
|
198
|
+
<!-- /reference:responsive-breakpoints:1 -->
|
|
190
199
|
|
|
191
200
|
Example: `waterfall-slides-per-view="3"` + `waterfall-slides-per-view-tablet="2"` + `waterfall-slides-per-view-mobile-large="1"` shows 3 slides on Desktop and up, 2 on Tablet, and 1 on both mobile breakpoints.
|
|
192
201
|
|
|
193
202
|
### Playback (Loop, Rewind, Speed)
|
|
194
203
|
|
|
195
|
-
|
|
196
|
-
|
|
|
197
|
-
|
|
|
198
|
-
| `waterfall-
|
|
199
|
-
| `waterfall-
|
|
200
|
-
| `waterfall-
|
|
201
|
-
| `waterfall-loop-
|
|
202
|
-
| `waterfall-
|
|
204
|
+
<!-- reference:playback-loop-rewind-speed:0 -->
|
|
205
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
206
|
+
| ---------------------------------- | ---------------------- | ----------- | ------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
207
|
+
| `waterfall-loop` | `loop` | boolean | `false` | Wraps around endlessly. Cannot be combined with `waterfall-rewind`; if both are `true`, loop wins and a warning is logged. |
|
|
208
|
+
| `waterfall-rewind` | `rewind` | boolean | `false` | Jumps back to the first slide after the last one. Cannot be combined with `waterfall-loop`. |
|
|
209
|
+
| `waterfall-speed` | `speed` | number (ms) | `300` | Transition duration between slides. |
|
|
210
|
+
| `waterfall-loop-add-blank-slides` | `loopAddBlankSlides` | boolean | `true` | With loop and grid/`slidesPerGroup`, adds blank slides when the slide count isn't evenly divisible. |
|
|
211
|
+
| `waterfall-loop-additional-slides` | `loopAdditionalSlides` | number | `0` | Extra slides to clone for looping. |
|
|
212
|
+
| `waterfall-loop-prevents-sliding` | `loopPreventsSliding` | boolean | `true` | Blocks navigation while the loop is repositioning slides. |
|
|
213
|
+
| `waterfall-one-way-movement` | `oneWayMovement` | boolean | `false` | Swiping in either direction advances to the next slide. |
|
|
214
|
+
<!-- /reference:playback-loop-rewind-speed:0 -->
|
|
203
215
|
|
|
204
216
|
### Autoplay
|
|
205
217
|
|
|
206
|
-
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
| `waterfall-
|
|
210
|
-
| `waterfall-
|
|
211
|
-
| `waterfall-
|
|
212
|
-
| `waterfall-
|
|
213
|
-
| `waterfall-
|
|
214
|
-
| `waterfall-
|
|
218
|
+
<!-- reference:autoplay:0 -->
|
|
219
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
220
|
+
| ------------------------------------------- | ------------------------------- | ----------- | ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
221
|
+
| `waterfall-autoplay` | `autoplay` | boolean | `false` | Turns autoplay on. The other autoplay attributes apply only when this is `true`. |
|
|
222
|
+
| `waterfall-autoplay-delay` | `autoplay.delay` | number (ms) | `3000` | Time between transitions. |
|
|
223
|
+
| `waterfall-smooth-autoplay` | — | boolean | `false` | Continuous "marquee" scrolling: sets the delay to `0` and applies linear easing to `.swiper-wrapper`. Pair it with a high `waterfall-speed` (e.g. `5000`). |
|
|
224
|
+
| `waterfall-autoplay-disable-on-interaction` | `autoplay.disableOnInteraction` | boolean | `false` | Stops autoplay permanently after the user interacts with the slider. |
|
|
225
|
+
| `waterfall-autoplay-pause-on-mouse-enter` | `autoplay.pauseOnMouseEnter` | boolean | `false` | Pauses while the pointer is over the slider. |
|
|
226
|
+
| `waterfall-autoplay-reverse-direction` | `autoplay.reverseDirection` | boolean | `false` | Autoplays backwards. |
|
|
227
|
+
| `waterfall-autoplay-stop-on-last-slide` | `autoplay.stopOnLastSlide` | boolean | `false` | Stops on the last slide. Has no effect in loop mode. |
|
|
228
|
+
| `waterfall-autoplay-wait-for-transition` | `autoplay.waitForTransition` | boolean | `true` | Waits for the slide transition to finish before the next autoplay step. Turn off when using `waterfall-virtual-translate`. |
|
|
229
|
+
<!-- /reference:autoplay:0 -->
|
|
215
230
|
|
|
216
231
|
### Autoplay Control Button
|
|
217
232
|
|
|
218
|
-
A play/pause toggle for autoplaying sliders. It requires `waterfall-autoplay
|
|
233
|
+
A play/pause toggle for autoplaying sliders. It requires `waterfall-autoplay="true"` and all three [elements](#element-reference) (`autoplay-control`, `autoplay-control-play`, `autoplay-control-pause`) inside the wrapper. The button shows the pause icon while playing and the play icon while paused.
|
|
219
234
|
|
|
235
|
+
<!-- reference:autoplay-control-button:0 -->
|
|
220
236
|
| Attribute | Values | Default | Description |
|
|
221
237
|
| ------------------------------------------ | --------------------- | --------- | ------------------------------------------------------- |
|
|
222
238
|
| `waterfall-autoplay-control-enabled` | boolean | `false` | Turns on the play/pause button. |
|
|
223
239
|
| `waterfall-autoplay-control-default-state` | `playing` \| `paused` | `playing` | Whether autoplay starts running or paused on page load. |
|
|
240
|
+
<!-- /reference:autoplay-control-button:0 -->
|
|
224
241
|
|
|
225
242
|
### Navigation
|
|
226
243
|
|
|
227
244
|
Navigation turns on automatically when a `navigation-next` or `navigation-prev` [element](#element-reference) is found inside the wrapper.
|
|
228
245
|
|
|
246
|
+
<!-- reference:navigation:0 -->
|
|
229
247
|
| Attribute | Swiper option | Values | Default | Description |
|
|
230
248
|
| ------------------------------------------------ | ------------------------------------ | ------- | ---------------------------- | ----------------------------------------------------------------- |
|
|
231
249
|
| `waterfall-navigation-enabled` | `navigation.enabled` | boolean | _(auto)_ | Set to `false` to turn navigation off even when buttons exist. |
|
|
@@ -236,11 +254,13 @@ Navigation turns on automatically when a `navigation-next` or `navigation-prev`
|
|
|
236
254
|
| `waterfall-navigation-hidden-class` | `navigation.hiddenClass` | string | `swiper-button-hidden` | Class added to hidden buttons. |
|
|
237
255
|
| `waterfall-navigation-lock-class` | `navigation.lockClass` | string | `swiper-button-lock` | Class added when navigation is locked (not enough slides). |
|
|
238
256
|
| `waterfall-navigation-navigation-disabled-class` | `navigation.navigationDisabledClass` | string | `swiper-navigation-disabled` | Class added to the container when navigation is disabled. |
|
|
257
|
+
<!-- /reference:navigation:0 -->
|
|
239
258
|
|
|
240
259
|
### Pagination
|
|
241
260
|
|
|
242
|
-
Pagination turns on when a `pagination` [element](#element-reference) is found inside the wrapper. To
|
|
261
|
+
Pagination turns on when a `pagination` [element](#element-reference) is found inside the wrapper. To change the tag used for bullets, add a `pagination-bullet` element and Waterfall uses its tag name. Set the bullet class with `waterfall-pagination-bullet-class`.
|
|
243
262
|
|
|
263
|
+
<!-- reference:pagination:0 -->
|
|
244
264
|
| Attribute | Swiper option | Values | Default | Description |
|
|
245
265
|
| ------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------- | ---------------------------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
246
266
|
| `waterfall-pagination-type` | `pagination.type` | `bullets` \| `numberBullets` \| `fraction` \| `progressbar` \| `custom` | `bullets` | Pagination style. `numberBullets` shows bullets containing the slide number. |
|
|
@@ -262,11 +282,14 @@ Pagination turns on when a `pagination` [element](#element-reference) is found i
|
|
|
262
282
|
| `waterfall-pagination-pagination-disabled-class` | `pagination.paginationDisabledClass` | string | `swiper-pagination-disabled` | Class added when pagination is disabled. |
|
|
263
283
|
| `waterfall-pagination-progressbar-fill-class` | `pagination.progressbarFillClass` | string | `swiper-pagination-progressbar-fill` | Class on the progress bar fill. |
|
|
264
284
|
| `waterfall-pagination-progressbar-opposite-class` | `pagination.progressbarOppositeClass` | string | `swiper-pagination-progressbar-opposite` | Class added with an opposite progress bar. |
|
|
285
|
+
| `waterfall-pagination-bullet-class` | `pagination.bulletClass` | string | `swiper-pagination-bullet` | Class applied to every generated bullet. |
|
|
286
|
+
<!-- /reference:pagination:0 -->
|
|
265
287
|
|
|
266
288
|
### Scrollbar
|
|
267
289
|
|
|
268
|
-
The scrollbar turns on when a `scrollbar` [element](#element-reference) is found inside the wrapper.
|
|
290
|
+
The scrollbar turns on when a `scrollbar` [element](#element-reference) is found inside the wrapper. Swiper creates the drag handle itself; style it with `waterfall-scrollbar-drag-class`.
|
|
269
291
|
|
|
292
|
+
<!-- reference:scrollbar:0 -->
|
|
270
293
|
| Attribute | Swiper option | Values | Default | Description |
|
|
271
294
|
| ---------------------------------------------- | ---------------------------------- | --------------------- | ----------------------------- | ---------------------------------------------------------------------- |
|
|
272
295
|
| `waterfall-scrollbar-enabled` | `scrollbar.enabled` | boolean | _(auto)_ | Set to `false` to turn the scrollbar off even when the element exists. |
|
|
@@ -278,53 +301,67 @@ The scrollbar turns on when a `scrollbar` [element](#element-reference) is found
|
|
|
278
301
|
| `waterfall-scrollbar-vertical-class` | `scrollbar.verticalClass` | string | `swiper-scrollbar-vertical` | Class added for vertical sliders. |
|
|
279
302
|
| `waterfall-scrollbar-lock-class` | `scrollbar.lockClass` | string | `swiper-scrollbar-lock` | Class added when the scrollbar is locked (not enough slides). |
|
|
280
303
|
| `waterfall-scrollbar-scrollbar-disabled-class` | `scrollbar.scrollbarDisabledClass` | string | `swiper-scrollbar-disabled` | Class added when the scrollbar is disabled. |
|
|
304
|
+
| `waterfall-scrollbar-drag-class` | `scrollbar.dragClass` | string | `swiper-scrollbar-drag` | Class applied to the drag handle. |
|
|
305
|
+
<!-- /reference:scrollbar:0 -->
|
|
281
306
|
|
|
282
307
|
### Effects
|
|
283
308
|
|
|
284
|
-
|
|
285
|
-
|
|
|
286
|
-
|
|
|
309
|
+
<!-- reference:effects:0 -->
|
|
310
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
311
|
+
| ---------------------------- | ----------------- | --------------------------------------------------------------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
312
|
+
| `waterfall-effect` | `effect` | `slide` \| `fade` \| `cube` \| `coverflow` \| `flip` \| `cards` | `slide` | Transition effect. Tune `fade` with `waterfall-fade-effect-mode`. |
|
|
313
|
+
| `waterfall-fade-effect-mode` | `fadeEffect.mode` | `default` \| `cross-fade` \| `out-in` | `default` | How the `fade` effect transitions. `default` fades the outgoing slide over the incoming one, `cross-fade` fades both at once, `out-in` fades out fully before fading in. |
|
|
314
|
+
<!-- /reference:effects:0 -->
|
|
287
315
|
|
|
288
316
|
The settings below apply only when the matching effect is selected.
|
|
289
317
|
|
|
290
318
|
**Coverflow** (`waterfall-effect="coverflow"`)
|
|
291
319
|
|
|
292
|
-
|
|
293
|
-
|
|
|
294
|
-
|
|
|
295
|
-
| `waterfall-coverflow-
|
|
296
|
-
| `waterfall-coverflow-
|
|
297
|
-
| `waterfall-coverflow-
|
|
298
|
-
| `waterfall-coverflow-
|
|
299
|
-
| `waterfall-coverflow-
|
|
320
|
+
<!-- reference:effects:1 -->
|
|
321
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
322
|
+
| ------------------------------------------ | ------------------------------ | ------------ | ------- | ------------------------------------------------- |
|
|
323
|
+
| `waterfall-coverflow-effect-rotate` | `coverflowEffect.rotate` | number (deg) | `50` | Rotation of the side slides. |
|
|
324
|
+
| `waterfall-coverflow-effect-stretch` | `coverflowEffect.stretch` | number (px) | `0` | Space between slides. |
|
|
325
|
+
| `waterfall-coverflow-effect-depth` | `coverflowEffect.depth` | number (px) | `100` | Depth offset (Z translation). |
|
|
326
|
+
| `waterfall-coverflow-effect-scale` | `coverflowEffect.scale` | number | `1` | Scale of the side slides. |
|
|
327
|
+
| `waterfall-coverflow-effect-modifier` | `coverflowEffect.modifier` | number | `1` | Multiplier applied to rotate, depth, and stretch. |
|
|
328
|
+
| `waterfall-coverflow-effect-slide-shadows` | `coverflowEffect.slideShadows` | boolean | `true` | Shows shadows on the slides. |
|
|
329
|
+
<!-- /reference:effects:1 -->
|
|
300
330
|
|
|
301
331
|
**Cube** (`waterfall-effect="cube"`)
|
|
302
332
|
|
|
303
|
-
|
|
304
|
-
|
|
|
305
|
-
|
|
|
306
|
-
| `waterfall-cube-shadow
|
|
307
|
-
| `waterfall-cube-shadow-
|
|
308
|
-
| `waterfall-cube-
|
|
333
|
+
<!-- reference:effects:2 -->
|
|
334
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
335
|
+
| ------------------------------------- | ------------------------- | ----------- | ------- | ------------------------------------- |
|
|
336
|
+
| `waterfall-cube-effect-shadow` | `cubeEffect.shadow` | boolean | `true` | Shows the main shadow under the cube. |
|
|
337
|
+
| `waterfall-cube-effect-shadow-offset` | `cubeEffect.shadowOffset` | number (px) | `20` | Offset of the main shadow. |
|
|
338
|
+
| `waterfall-cube-effect-shadow-scale` | `cubeEffect.shadowScale` | number | `0.94` | Scale of the main shadow. |
|
|
339
|
+
| `waterfall-cube-effect-slide-shadows` | `cubeEffect.slideShadows` | boolean | `true` | Shows shadows on the slides. |
|
|
340
|
+
<!-- /reference:effects:2 -->
|
|
309
341
|
|
|
310
342
|
**Flip** (`waterfall-effect="flip"`)
|
|
311
343
|
|
|
312
|
-
|
|
313
|
-
|
|
|
314
|
-
|
|
|
315
|
-
| `waterfall-flip-
|
|
344
|
+
<!-- reference:effects:3 -->
|
|
345
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
346
|
+
| -------------------------------------- | -------------------------- | ------- | ------- | --------------------------------------- |
|
|
347
|
+
| `waterfall-flip-effect-limit-rotation` | `flipEffect.limitRotation` | boolean | `true` | Limits the rotation of the edge slides. |
|
|
348
|
+
| `waterfall-flip-effect-slide-shadows` | `flipEffect.slideShadows` | boolean | `true` | Shows shadows on the slides. |
|
|
349
|
+
<!-- /reference:effects:3 -->
|
|
316
350
|
|
|
317
351
|
**Cards** (`waterfall-effect="cards"`)
|
|
318
352
|
|
|
319
|
-
|
|
320
|
-
|
|
|
321
|
-
|
|
|
322
|
-
| `waterfall-cards-per-slide-
|
|
323
|
-
| `waterfall-cards-rotate`
|
|
324
|
-
| `waterfall-cards-
|
|
353
|
+
<!-- reference:effects:4 -->
|
|
354
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
355
|
+
| ----------------------------------------- | ---------------------------- | ------------ | ------- | ------------------------------ |
|
|
356
|
+
| `waterfall-cards-effect-per-slide-offset` | `cardsEffect.perSlideOffset` | number (px) | `8` | Offset between stacked cards. |
|
|
357
|
+
| `waterfall-cards-effect-per-slide-rotate` | `cardsEffect.perSlideRotate` | number (deg) | `2` | Rotation of each stacked card. |
|
|
358
|
+
| `waterfall-cards-effect-rotate` | `cardsEffect.rotate` | boolean | `true` | Rotates the cards. |
|
|
359
|
+
| `waterfall-cards-effect-slide-shadows` | `cardsEffect.slideShadows` | boolean | `true` | Shows shadows on the cards. |
|
|
360
|
+
<!-- /reference:effects:4 -->
|
|
325
361
|
|
|
326
362
|
### Free Mode
|
|
327
363
|
|
|
364
|
+
<!-- reference:free-mode:0 -->
|
|
328
365
|
| Attribute | Swiper option | Values | Default | Description |
|
|
329
366
|
| --------------------------------------------- | -------------------------------- | ------- | ------- | -------------------------------------------------------- |
|
|
330
367
|
| `waterfall-free-mode-enabled` | `freeMode.enabled` | boolean | `false` | Slides move freely without snapping to positions. |
|
|
@@ -335,43 +372,51 @@ The settings below apply only when the matching effect is selected.
|
|
|
335
372
|
| `waterfall-free-mode-momentum-bounce` | `freeMode.momentumBounce` | boolean | `true` | Bounces at the edges after momentum. |
|
|
336
373
|
| `waterfall-free-mode-momentum-bounce-ratio` | `freeMode.momentumBounceRatio` | number | `1` | Higher values increase the bounce effect. |
|
|
337
374
|
| `waterfall-free-mode-minimum-velocity` | `freeMode.minimumVelocity` | number | `0.02` | Minimum touchmove velocity required to trigger momentum. |
|
|
375
|
+
<!-- /reference:free-mode:0 -->
|
|
338
376
|
|
|
339
377
|
### Grid
|
|
340
378
|
|
|
379
|
+
<!-- reference:grid:0 -->
|
|
341
380
|
| Attribute | Swiper option | Values | Default | Description |
|
|
342
381
|
| --------------------- | ------------- | ----------------- | -------- | --------------------------------------------------- |
|
|
343
382
|
| `waterfall-grid-rows` | `grid.rows` | number | `1` | Number of slide rows. Works best without loop mode. |
|
|
344
383
|
| `waterfall-grid-fill` | `grid.fill` | `row` \| `column` | `column` | Whether slides fill the grid by row or by column. |
|
|
384
|
+
<!-- /reference:grid:0 -->
|
|
345
385
|
|
|
346
386
|
### Thumbs
|
|
347
387
|
|
|
348
|
-
Links a main slider to a separate thumbnail slider. Add the attributes to the **main** slider; the value of `waterfall-thumbs` is the name of the thumbnail Waterfall. Waterfall initializes the thumbnail slider first, so the order of the sliders on the page doesn't matter.
|
|
388
|
+
Links a main slider to a separate thumbnail slider. Add the attributes to the **main** slider; the value of `waterfall-thumbs-swiper` is the name of the thumbnail Waterfall. Waterfall initializes the thumbnail slider first, so the order of the sliders on the page doesn't matter.
|
|
349
389
|
|
|
350
390
|
```html
|
|
351
|
-
<div waterfall="gallery" waterfall-thumbs="gallery-thumbs">…</div>
|
|
391
|
+
<div waterfall="gallery" waterfall-thumbs-swiper="gallery-thumbs">…</div>
|
|
352
392
|
<div waterfall="gallery-thumbs" waterfall-slides-per-view="4" waterfall-watch-slides-progress="true">…</div>
|
|
353
393
|
```
|
|
354
394
|
|
|
355
|
-
|
|
356
|
-
|
|
|
357
|
-
|
|
|
358
|
-
| `waterfall-thumbs-
|
|
359
|
-
| `waterfall-thumbs-
|
|
360
|
-
| `waterfall-
|
|
361
|
-
| `waterfall-thumbs-
|
|
395
|
+
<!-- reference:thumbs:0 -->
|
|
396
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
397
|
+
| ------------------------------------------- | ------------------------------ | -------------- | --------------------------- | -------------------------------------------------------------------------------------------- |
|
|
398
|
+
| `waterfall-thumbs-swiper` | `thumbs.swiper` | Waterfall name | — | Name of the thumbnail slider to link. |
|
|
399
|
+
| `waterfall-thumbs-auto-scroll-offset` | `thumbs.autoScrollOffset` | number | `0` | Offset from the edge at which the thumbnail slider scrolls to keep the active thumb visible. |
|
|
400
|
+
| `waterfall-thumbs-multiple-active-thumbs` | `thumbs.multipleActiveThumbs` | boolean | `true` | With multiple slides per view, highlights every thumb that is visible in the main slider. |
|
|
401
|
+
| `waterfall-thumbs-slide-thumb-active-class` | `thumbs.slideThumbActiveClass` | string | `swiper-slide-thumb-active` | Class added to the active thumbnail. |
|
|
402
|
+
| `waterfall-thumbs-thumbs-container-class` | `thumbs.thumbsContainerClass` | string | `swiper-thumbs` | Class added to the thumbnail slider container. |
|
|
403
|
+
<!-- /reference:thumbs:0 -->
|
|
362
404
|
|
|
363
405
|
### Controller
|
|
364
406
|
|
|
365
|
-
Makes one slider drive another. The value of `waterfall-controller` is the name of the Waterfall to control. The controlled slider is initialized first. For two-way sync, add `waterfall-controller` to both sliders.
|
|
407
|
+
Makes one slider drive another. The value of `waterfall-controller-control` is the name of the Waterfall to control. The controlled slider is initialized first. For two-way sync, add `waterfall-controller-control` to both sliders.
|
|
366
408
|
|
|
409
|
+
<!-- reference:controller:0 -->
|
|
367
410
|
| Attribute | Swiper option | Values | Default | Description |
|
|
368
411
|
| ------------------------------ | -------------------- | ---------------------- | ------- | -------------------------------------------------------------------------------- |
|
|
369
|
-
| `waterfall-controller`
|
|
412
|
+
| `waterfall-controller-control` | `controller.control` | Waterfall name | — | Name of the slider to control. |
|
|
370
413
|
| `waterfall-controller-by` | `controller.by` | `slide` \| `container` | `slide` | Syncs by slide index (`slide`) or by proportional scroll position (`container`). |
|
|
371
414
|
| `waterfall-controller-inverse` | `controller.inverse` | boolean | `false` | Moves the controlled slider in the opposite direction. |
|
|
415
|
+
<!-- /reference:controller:0 -->
|
|
372
416
|
|
|
373
417
|
### Touch & Swiping
|
|
374
418
|
|
|
419
|
+
<!-- reference:touch-swiping:0 -->
|
|
375
420
|
| Attribute | Swiper option | Values | Default | Description |
|
|
376
421
|
| --------------------------------------------- | -------------------------------- | ------------------------ | ------------------------------------------------------- | --------------------------------------------------------------------------------- |
|
|
377
422
|
| `waterfall-allow-touch-move` | `allowTouchMove` | boolean | `true` | Set to `false` to turn off swiping; only navigation and pagination remain. |
|
|
@@ -403,53 +448,63 @@ Makes one slider drive another. The value of `waterfall-controller` is the name
|
|
|
403
448
|
| `waterfall-no-swiping-selector` | `noSwipingSelector` | CSS selector | — | Swiping is blocked on elements matching this selector (overrides the class). |
|
|
404
449
|
| `waterfall-focusable-elements` | `focusableElements` | CSS selector | `input, select, option, textarea, button, video, label` | Elements that keep native focus behavior instead of starting a swipe. |
|
|
405
450
|
| `waterfall-swipe-handler` | `swipeHandler` | CSS selector | — | Restricts swiping to this handle element. |
|
|
451
|
+
<!-- /reference:touch-swiping:0 -->
|
|
406
452
|
|
|
407
453
|
### Keyboard Control
|
|
408
454
|
|
|
455
|
+
<!-- reference:keyboard-control:0 -->
|
|
409
456
|
| Attribute | Swiper option | Values | Default | Description |
|
|
410
457
|
| ------------------------------------- | ------------------------- | ------- | ------- | ---------------------------------------------------------- |
|
|
411
458
|
| `waterfall-keyboard-enabled` | `keyboard.enabled` | boolean | `false` | Arrow keys control the slider. |
|
|
412
459
|
| `waterfall-keyboard-only-in-viewport` | `keyboard.onlyInViewport` | boolean | `true` | Responds to keys only while the slider is in the viewport. |
|
|
413
460
|
| `waterfall-keyboard-page-up-down` | `keyboard.pageUpDown` | boolean | `true` | Page Up / Page Down also navigate. |
|
|
461
|
+
<!-- /reference:keyboard-control:0 -->
|
|
414
462
|
|
|
415
463
|
### Mousewheel Control
|
|
416
464
|
|
|
417
|
-
|
|
418
|
-
|
|
|
419
|
-
|
|
|
420
|
-
| `waterfall-
|
|
421
|
-
| `waterfall-
|
|
422
|
-
| `waterfall-
|
|
423
|
-
| `waterfall-
|
|
424
|
-
| `waterfall-
|
|
425
|
-
| `waterfall-
|
|
426
|
-
| `waterfall-
|
|
427
|
-
| `waterfall-
|
|
465
|
+
<!-- reference:mousewheel-control:0 -->
|
|
466
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
467
|
+
| ------------------------------------------ | ------------------------------ | ---------------------------------------- | ---------------------- | --------------------------------------------------------------------- |
|
|
468
|
+
| `waterfall-mousewheel-enabled` | `mousewheel.enabled` | boolean | `false` | The mouse wheel controls the slider. |
|
|
469
|
+
| `waterfall-mousewheel-force-to-axis` | `mousewheel.forceToAxis` | boolean | `false` | Only responds to wheel movement along the slider's direction. |
|
|
470
|
+
| `waterfall-mousewheel-invert` | `mousewheel.invert` | boolean | `false` | Inverts the scroll direction. |
|
|
471
|
+
| `waterfall-mousewheel-release-on-edges` | `mousewheel.releaseOnEdges` | boolean | `false` | Lets the page scroll once the slider reaches its first or last slide. |
|
|
472
|
+
| `waterfall-mousewheel-sensitivity` | `mousewheel.sensitivity` | number | `1` | Wheel sensitivity multiplier. |
|
|
473
|
+
| `waterfall-mousewheel-threshold-delta` | `mousewheel.thresholdDelta` | number | — | Minimum wheel delta needed to trigger a slide change. |
|
|
474
|
+
| `waterfall-mousewheel-threshold-time` | `mousewheel.thresholdTime` | number (ms) | — | Minimum time between wheel-triggered slide changes. |
|
|
475
|
+
| `waterfall-mousewheel-events-target` | `mousewheel.eventsTarget` | `container` \| `wrapper` \| CSS selector | `container` | Element that listens for wheel events. |
|
|
476
|
+
| `waterfall-mousewheel-no-mousewheel-class` | `mousewheel.noMousewheelClass` | string | `swiper-no-mousewheel` | The mouse wheel is ignored over elements with this class. |
|
|
477
|
+
<!-- /reference:mousewheel-control:0 -->
|
|
428
478
|
|
|
429
479
|
### Hash Navigation
|
|
430
480
|
|
|
431
481
|
Syncs the active slide with the URL hash. Add `data-hash="my-slide"` to each slide. Setting either attribute below to `true` turns hash navigation on.
|
|
432
482
|
|
|
433
|
-
|
|
434
|
-
|
|
|
435
|
-
|
|
|
436
|
-
| `waterfall-hash-
|
|
483
|
+
<!-- reference:hash-navigation:0 -->
|
|
484
|
+
| Attribute | Swiper option | Values | Default | Description |
|
|
485
|
+
| ----------------------------------------- | ----------------------------- | ------- | ------- | ---------------------------------------------------------------------- |
|
|
486
|
+
| `waterfall-hash-navigation-watch-state` | `hashNavigation.watchState` | boolean | `false` | Changes slides when the hash changes (e.g. browser back/forward). |
|
|
487
|
+
| `waterfall-hash-navigation-replace-state` | `hashNavigation.replaceState` | boolean | `false` | Replaces the history entry instead of adding a new one on each change. |
|
|
488
|
+
<!-- /reference:hash-navigation:0 -->
|
|
437
489
|
|
|
438
490
|
### History Navigation
|
|
439
491
|
|
|
440
492
|
Syncs the active slide with the URL path (e.g. `/slides/my-slide`). Add `data-history="my-slide"` to each slide. Setting any attribute below to a non-default value turns history navigation on.
|
|
441
493
|
|
|
494
|
+
<!-- reference:history-navigation:0 -->
|
|
442
495
|
| Attribute | Swiper option | Values | Default | Description |
|
|
443
496
|
| --------------------------------- | ---------------------- | ------- | -------- | ------------------------------------------------------- |
|
|
444
497
|
| `waterfall-history-key` | `history.key` | string | `slides` | URL segment placed before the slide name. |
|
|
445
498
|
| `waterfall-history-root` | `history.root` | string | `""` | Base URL path for history entries. |
|
|
446
499
|
| `waterfall-history-replace-state` | `history.replaceState` | boolean | `false` | Replaces the history entry instead of adding a new one. |
|
|
447
500
|
| `waterfall-history-keep-query` | `history.keepQuery` | boolean | `false` | Keeps the URL query parameters when the URL is updated. |
|
|
501
|
+
<!-- /reference:history-navigation:0 -->
|
|
448
502
|
|
|
449
503
|
### Zoom
|
|
450
504
|
|
|
451
505
|
Double-tap or pinch to zoom. Wrap each slide's image in `<div class="swiper-zoom-container">`. Setting any attribute below to a non-default value turns zoom on (e.g. `waterfall-zoom-max-ratio="4"`).
|
|
452
506
|
|
|
507
|
+
<!-- reference:zoom:0 -->
|
|
453
508
|
| Attribute | Swiper option | Values | Default | Description |
|
|
454
509
|
| --------------------------------------- | -------------------------- | ------- | ----------------------- | ------------------------------------------ |
|
|
455
510
|
| `waterfall-zoom-max-ratio` | `zoom.maxRatio` | number | `3` | Maximum zoom level. |
|
|
@@ -458,16 +513,20 @@ Double-tap or pinch to zoom. Wrap each slide's image in `<div class="swiper-zoom
|
|
|
458
513
|
| `waterfall-zoom-limit-to-original-size` | `zoom.limitToOriginalSize` | boolean | `false` | Never zooms past the image's natural size. |
|
|
459
514
|
| `waterfall-zoom-pan-on-mouse-move` | `zoom.panOnMouseMove` | boolean | `false` | Pans the zoomed image by moving the mouse. |
|
|
460
515
|
| `waterfall-zoom-container-class` | `zoom.containerClass` | string | `swiper-zoom-container` | Class of the zoom container element. |
|
|
461
|
-
| `waterfall-zoomed-slide-class`
|
|
516
|
+
| `waterfall-zoom-zoomed-slide-class` | `zoom.zoomedSlideClass` | string | `swiper-slide-zoomed` | Class added to the zoomed slide. |
|
|
517
|
+
<!-- /reference:zoom:0 -->
|
|
462
518
|
|
|
463
519
|
### Parallax
|
|
464
520
|
|
|
521
|
+
<!-- reference:parallax:0 -->
|
|
465
522
|
| Attribute | Swiper option | Values | Default | Description |
|
|
466
523
|
| ---------------------------- | ------------------ | ------- | ------- | ------------------------------------------------- |
|
|
467
524
|
| `waterfall-parallax-enabled` | `parallax.enabled` | boolean | `false` | Turns on parallax for elements inside the slider. |
|
|
525
|
+
<!-- /reference:parallax:0 -->
|
|
468
526
|
|
|
469
527
|
With parallax on, add SwiperJS's native parallax attributes to elements **inside** the slides (or on a background element inside `.swiper`):
|
|
470
528
|
|
|
529
|
+
<!-- reference:parallax:1 -->
|
|
471
530
|
| Attribute | Values | Description |
|
|
472
531
|
| ------------------------------- | ----------------------------- | ---------------------------------------------------------------------------- |
|
|
473
532
|
| `data-swiper-parallax` | px or % (e.g. `-300`, `-50%`) | Horizontal offset for horizontal sliders, vertical offset for vertical ones. |
|
|
@@ -476,20 +535,24 @@ With parallax on, add SwiperJS's native parallax attributes to elements **inside
|
|
|
476
535
|
| `data-swiper-parallax-scale` | number | Scale while the slide is out of view. |
|
|
477
536
|
| `data-swiper-parallax-opacity` | number (0–1) | Opacity while the slide is out of view. |
|
|
478
537
|
| `data-swiper-parallax-duration` | number (ms) | Custom transition duration for this element. |
|
|
538
|
+
<!-- /reference:parallax:1 -->
|
|
479
539
|
|
|
480
540
|
### Lazy Loading
|
|
481
541
|
|
|
482
542
|
Add `loading="lazy"` to slide images (Webflow does this by default). Swiper can preload images in neighboring slides.
|
|
483
543
|
|
|
544
|
+
<!-- reference:lazy-loading:0 -->
|
|
484
545
|
| Attribute | Swiper option | Values | Default | Description |
|
|
485
546
|
| ---------------------------------- | --------------------- | ------ | ----------------------- | -------------------------------------------------------------------------------- |
|
|
486
547
|
| `waterfall-lazy-preload-prev-next` | `lazyPreloadPrevNext` | number | `0` | Number of slides before and after the active slide whose lazy images load early. |
|
|
487
548
|
| `waterfall-lazy-preloader-class` | `lazyPreloaderClass` | string | `swiper-lazy-preloader` | Class of the preloader element that is removed once the image loads. |
|
|
549
|
+
<!-- /reference:lazy-loading:0 -->
|
|
488
550
|
|
|
489
551
|
### Accessibility (a11y)
|
|
490
552
|
|
|
491
553
|
Accessibility is **on by default**. Message attributes support the `{{index}}` and `{{slidesLength}}` placeholders.
|
|
492
554
|
|
|
555
|
+
<!-- reference:accessibility-a11y:0 -->
|
|
493
556
|
| Attribute | Swiper option | Values | Default | Description |
|
|
494
557
|
| --------------------------------------------------- | -------------------------------------- | ------- | ------------------------------ | ---------------------------------------------------------------------- |
|
|
495
558
|
| `waterfall-a11y-enabled` | `a11y.enabled` | boolean | `true` | Turns accessibility features on or off. |
|
|
@@ -507,9 +570,11 @@ Accessibility is **on by default**. Message attributes support the `{{index}}` a
|
|
|
507
570
|
| `waterfall-a11y-id` | `a11y.id` | string | _(random)_ | ID for the wrapper, used by `aria-controls` on the navigation buttons. |
|
|
508
571
|
| `waterfall-a11y-notification-class` | `a11y.notificationClass` | string | `swiper-notification` | Class of the live-region element used for announcements. |
|
|
509
572
|
| `waterfall-a11y-scroll-on-focus` | `a11y.scrollOnFocus` | boolean | `true` | Scrolls to a slide when it receives keyboard focus. |
|
|
573
|
+
<!-- /reference:accessibility-a11y:0 -->
|
|
510
574
|
|
|
511
575
|
### Observer
|
|
512
576
|
|
|
577
|
+
<!-- reference:observer:0 -->
|
|
513
578
|
| Attribute | Swiper option | Values | Default | Description |
|
|
514
579
|
| ----------------------------------- | ---------------------- | ------- | ------- | ---------------------------------------------------------------------------------------------------- |
|
|
515
580
|
| `waterfall-observer` | `observer` | boolean | `false` | Re-initializes the slider when its style or slides change. Useful for sliders inside tabs or modals. |
|
|
@@ -519,11 +584,13 @@ Accessibility is **on by default**. Message attributes support the `{{index}}` a
|
|
|
519
584
|
| `waterfall-update-on-window-resize` | `updateOnWindowResize` | boolean | `true` | Recalculates the layout when the window is resized. |
|
|
520
585
|
| `waterfall-watch-overflow` | `watchOverflow` | boolean | `true` | Disables the slider and hides navigation when there aren't enough slides to scroll. |
|
|
521
586
|
| `waterfall-watch-slides-progress` | `watchSlidesProgress` | boolean | `false` | Tracks each slide's progress and adds visibility classes. Required on thumbnail sliders. |
|
|
587
|
+
<!-- /reference:observer:0 -->
|
|
522
588
|
|
|
523
589
|
### CSS Classes
|
|
524
590
|
|
|
525
591
|
Override the classes Swiper uses. Leave these at their defaults unless your markup uses different class names.
|
|
526
592
|
|
|
593
|
+
<!-- reference:css-classes:0 -->
|
|
527
594
|
| Attribute | Swiper option | Default |
|
|
528
595
|
| ------------------------------------- | ------------------------ | ---------------------------- |
|
|
529
596
|
| `waterfall-container-modifier-class` | `containerModifierClass` | `swiper-` |
|
|
@@ -535,11 +602,13 @@ Override the classes Swiper uses. Leave these at their defaults unless your mark
|
|
|
535
602
|
| `waterfall-slide-visible-class` | `slideVisibleClass` | `swiper-slide-visible` |
|
|
536
603
|
| `waterfall-slide-fully-visible-class` | `slideFullyVisibleClass` | `swiper-slide-fully-visible` |
|
|
537
604
|
| `waterfall-slide-blank-class` | `slideBlankClass` | `swiper-slide-blank` |
|
|
605
|
+
<!-- /reference:css-classes:0 -->
|
|
538
606
|
|
|
539
607
|
### Advanced
|
|
540
608
|
|
|
541
609
|
Rarely needed. Some of these can break other features, so change them only if you know you need to.
|
|
542
610
|
|
|
611
|
+
<!-- reference:advanced:0 -->
|
|
543
612
|
| Attribute | Swiper option | Values | Default | Description |
|
|
544
613
|
| -------------------------------------- | ------------------------- | ------- | ------------------ | ------------------------------------------------------------------------------------------------------- |
|
|
545
614
|
| `waterfall-enabled` | `enabled` | boolean | `true` | Set to `false` to create the slider in a disabled state. |
|
|
@@ -556,12 +625,16 @@ Rarely needed. Some of these can break other features, so change them only if yo
|
|
|
556
625
|
| `waterfall-swiper-element-node-name` | `swiperElementNodeName` | string | `SWIPER-CONTAINER` | Node name used to detect Swiper Element (web component) containers. |
|
|
557
626
|
| `waterfall-url` | `url` | string | — | Page URL for server-side rendering with history navigation. |
|
|
558
627
|
| `waterfall-user-agent` | `userAgent` | string | — | User agent for server-side rendering. |
|
|
628
|
+
| `waterfall-virtual-translate` | `virtualTranslate` | boolean | `false` | Runs the slider without ever translating the wrapper, for building a custom slide transition. |
|
|
629
|
+
<!-- /reference:advanced:0 -->
|
|
559
630
|
|
|
560
631
|
### Callbacks
|
|
561
632
|
|
|
633
|
+
<!-- reference:callbacks:0 -->
|
|
562
634
|
| Attribute | Values | Description |
|
|
563
635
|
| --------------------------------- | -------------------- | --------------------------------------------------------- |
|
|
564
636
|
| `waterfall-callback-slide-change` | Global function name | Calls `window[name]` every time the active slide changes. |
|
|
637
|
+
<!-- /reference:callbacks:0 -->
|
|
565
638
|
|
|
566
639
|
The function receives a single object:
|
|
567
640
|
|
|
@@ -581,6 +654,7 @@ TypeScript users can import the parameter type: `import type { SlideChangeCallba
|
|
|
581
654
|
|
|
582
655
|
Moves elements from elsewhere on the page into a Waterfall when the page loads, for example to inject a CTA card or content from a second CMS list. Put the attribute on the element to insert; its value is the target Waterfall's name. The element is cloned into the slider (with the `swiper-slide` class added if missing) and the original is removed. If the original was inside a Webflow Collection List (`.w-dyn-list`), that list is removed too.
|
|
583
656
|
|
|
657
|
+
<!-- reference:slide-manipulation:0 -->
|
|
584
658
|
| Attribute | Values | Description |
|
|
585
659
|
| ------------------------- | -------------- | ---------------------------------------------------------------------------------------------------------- |
|
|
586
660
|
| `waterfall-append-slide` | Waterfall name | Adds this element as the last slide. |
|
|
@@ -589,6 +663,7 @@ Moves elements from elsewhere on the page into a Waterfall when the page loads,
|
|
|
589
663
|
| `waterfall-add-index` | number | Position for `waterfall-add-slide` (defaults to `1`). |
|
|
590
664
|
| `waterfall-remove-slide` | Waterfall name | Removes the slide at `waterfall-remove-index` from the target slider. This element itself is also removed. |
|
|
591
665
|
| `waterfall-remove-index` | number | Index of the slide to remove. |
|
|
666
|
+
<!-- /reference:slide-manipulation:0 -->
|
|
592
667
|
|
|
593
668
|
```html
|
|
594
669
|
<div waterfall-append-slide="SWIPER_NAME" class="cta-card">Contact us</div>
|
|
@@ -598,18 +673,19 @@ Moves elements from elsewhere on the page into a Waterfall when the page loads,
|
|
|
598
673
|
|
|
599
674
|
Elements are identified with the `waterfall-el` attribute and must be placed **inside** the `[waterfall]` wrapper, so each slider finds its own controls.
|
|
600
675
|
|
|
601
|
-
|
|
602
|
-
|
|
|
603
|
-
|
|
|
604
|
-
| `navigation-
|
|
605
|
-
| `
|
|
606
|
-
| `pagination
|
|
607
|
-
| `
|
|
608
|
-
| `scrollbar
|
|
609
|
-
| `slide-count` | Placed inside a slide; its text is replaced with that slide's 1-based number.
|
|
610
|
-
| `autoplay-control` | Play/pause button. See [Autoplay Control Button](#autoplay-control-button).
|
|
611
|
-
| `autoplay-control-play` | Icon shown while autoplay is paused.
|
|
612
|
-
| `autoplay-control-pause` | Icon shown while autoplay is playing.
|
|
676
|
+
<!-- reference:element-reference:0 -->
|
|
677
|
+
| `waterfall-el` value | Purpose |
|
|
678
|
+
| ------------------------ | -------------------------------------------------------------------------------------------------------------------------------------- |
|
|
679
|
+
| `navigation-next` | Next slide button. Enables navigation. |
|
|
680
|
+
| `navigation-prev` | Previous slide button. Enables navigation. |
|
|
681
|
+
| `pagination` | Pagination container. Enables pagination. |
|
|
682
|
+
| `pagination-bullet` | Optional bullet template. Its **tag name** is used for every generated bullet; set the class with `waterfall-pagination-bullet-class`. |
|
|
683
|
+
| `scrollbar` | Scrollbar track. Enables the scrollbar. |
|
|
684
|
+
| `slide-count` | Placed inside a slide; its text is replaced with that slide's 1-based number. |
|
|
685
|
+
| `autoplay-control` | Play/pause button. See [Autoplay Control Button](#autoplay-control-button). |
|
|
686
|
+
| `autoplay-control-play` | Icon shown while autoplay is paused. |
|
|
687
|
+
| `autoplay-control-pause` | Icon shown while autoplay is playing. |
|
|
688
|
+
<!-- /reference:element-reference:0 -->
|
|
613
689
|
|
|
614
690
|
## JavaScript API
|
|
615
691
|
|
|
@@ -640,7 +716,7 @@ npm run build
|
|
|
640
716
|
|
|
641
717
|
## Built With
|
|
642
718
|
|
|
643
|
-
- [SwiperJS <!-- swiper-version -->14.
|
|
719
|
+
- [SwiperJS <!-- swiper-version -->14.4.0<!-- /swiper-version -->](https://github.com/nolimits4web/swiper)
|
|
644
720
|
- TypeScript
|
|
645
721
|
- Vite
|
|
646
722
|
|