From 88783348c70122665c3324e0fc0eea6da07c07f6 Mon Sep 17 00:00:00 2001 From: "Patrick H. Lauke" Date: Sat, 22 Oct 2022 09:50:00 +0100 Subject: [PATCH] Further prose tweaks move the sentence about not double-initialising autoplaying carousels to the callout right at the top instead of talking about `data-bs...` attributes, talk about the "option" instead, as authors may be setting these not via data attributes, but at instatiation time with options in the constructor remove the incorrect statement about pausing when keyboard focus is in the carousel --- site/content/docs/5.2/components/carousel.md | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/site/content/docs/5.2/components/carousel.md b/site/content/docs/5.2/components/carousel.md index 7ccdb73f5f..395ba840cc 100644 --- a/site/content/docs/5.2/components/carousel.md +++ b/site/content/docs/5.2/components/carousel.md @@ -19,7 +19,7 @@ Note that nested carousels are not supported. You should also be aware that caro {{< callout warning >}} For performance reasons, carousels must be manually initialized using the [carousel constructor method](#methods). Without initialization, some of the event listeners (specifically, the events needed touch/swipe support) will not be registered until a user has explicitly activated a control or indicator. -The only exception are [autoplaying carousels](#autoplaying-carousel) using the `data-bs-ride="carousel"` attribute – these are initialized automatically on page load. +The only exception are [autoplaying carousels](#autoplaying-carousel) with the `data-bs-ride="carousel"` attribute – these are initialized automatically on page load. If you are using autoplaying carousels with the data attribute, **don't explicitly initialize the same carousels with the constructor method.** {{< /callout >}} ## Basic examples @@ -162,7 +162,7 @@ Add `.carousel-fade` to your carousel to animate slides with a fade transition i ## Autoplaying carousels -You can make your carousels autoplay on page load by adding the `data-bs-ride="carousel"` attribute. +You can make your carousels autoplay on page load by setting the `ride` option to `carousel`. {{< callout info >}} For accessibility reasons, we recommend avoiding the use of autoplaying carousels. @@ -172,7 +172,7 @@ If your page does include an autoplaying carousel, we recommend providing an add See [WCAG 2.1 Success Criterion 2.2.2 Pause, Stop, Hide](https://www.w3.org/TR/WCAG21/#pause-stop-hide). {{< /callout >}} -Autoplaying carousels automatically pause while hovered with the mouse, and while keyboard focus is inside them. +Autoplaying carousels automatically pause while hovered with the mouse. This behavior can be controlled with the `pause` option. In browsers that support the [Page Visibility API](https://www.w3.org/TR/page-visibility/), the carousel will stop cycling when the webpage is not visible to the user (such as when the browser tab is inactive, or when the browser window is minimized). @@ -200,7 +200,7 @@ In browsers that support the [Page Visibility API](https://www.w3.org/TR/page-vi {{< /example >}} -Using `data-bs-ride="true"`, carousels won't automatically start to cycle on page load. Instead, they will only start after the first user interaction. +When the `ride` option is set to `true`, rather than `carousel`, the carousel won't automatically start to cycle on page load. Instead, it will only start after the first user interaction. {{< example >}}