You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: site/content/docs/5.0/components/carousel.md
+34-6Lines changed: 34 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -206,6 +206,34 @@ Add `data-bs-interval=""` to a `.carousel-item` to change the amount of time to
206
206
</div>
207
207
{{< /example >}}
208
208
209
+
### Suppressing touch swiping
210
+
211
+
By default, carousels support swiping left/right on touchscreen devices to move between slides. This can be explicitly suppressed using the `data-bs-touch` attribute. The example below also does not include the `data-bs-ride` attribute, and has `data-bs-interval="false"`, meaning that it won't autoplay.
Add `.carousel-dark` to the `.carousel` for darker controls, indicators, and captions. Controls have been inverted from their default white fill with the `filter` CSS property. Captions and controls have additional Sass variables that customize the `color` and `background-color`.
@@ -286,7 +314,7 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
286
314
<td><code>interval</code></td>
287
315
<td>number</td>
288
316
<td><code>5000</code></td>
289
-
<td>The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.</td>
317
+
<td>The amount of time to delay between automatically cycling an item. If <code>false</code>, carousel will not automatically cycle.</td>
290
318
</tr>
291
319
<tr>
292
320
<td><code>keyboard</code></td>
@@ -297,15 +325,15 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
297
325
<tr>
298
326
<td><code>pause</code></td>
299
327
<td>string | boolean</td>
300
-
<td><code>"hover"</code></td>
301
-
<td><p>If set to <code>"hover"</code>, pauses the cycling of the carousel on <code>mouseenter</code> and resumes the cycling of the carousel on <code>mouseleave</code>. If set to <code>false</code>, hovering over the carousel won't pause it.</p>
302
-
<p>On touch-enabled devices, when set to <code>"hover"</code>, cycling will pause on <code>touchend</code> (once the user finished interacting with the carousel) for two intervals, before automatically resuming. Note that this is in addition to the above mouse behavior.</p></td>
328
+
<td><code>'hover'</code></td>
329
+
<td><p>If set to <code>'hover'</code>, pauses the cycling of the carousel on <code>mouseenter</code> and resumes the cycling of the carousel on <code>mouseleave</code>. If set to <code>false</code>, hovering over the carousel won't pause it.</p>
330
+
<p>On touch-enabled devices, when set to <code>'hover'</code>, cycling will pause on <code>touchend</code> (once the user finished interacting with the carousel) for two intervals, before automatically resuming. Note that this is in addition to the above mouse behavior.</p></td>
303
331
</tr>
304
332
<tr>
305
-
<td><code>slide</code></td>
333
+
<td><code>ride</code></td>
306
334
<td>string | boolean</td>
307
335
<td><code>false</code></td>
308
-
<td>Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.</td>
336
+
<td>Autoplays the carousel after the user manually cycles the first item. If set to <code>'carousel'</code>, autoplays the carousel on load.</td>
0 commit comments