Skip to content

Commit

Permalink
v4: Add an actual data-touch="false" example in the carousel docs
Browse files Browse the repository at this point in the history
Backport of #32638
  • Loading branch information
patrickhlauke committed Dec 28, 2020
1 parent 4fc35bd commit ba6182a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions site/content/docs/4.5/components/carousel.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,34 @@ Add `data-interval=""` to a `.carousel-item` to change the amount of time to del
</div>
{{< /example >}}

### Suppressing touch swiping

By default, carousels support swiping left/right on touchscreen devices to move between slides. This can be explicitly suppressed using the `data-touch` attribute.

{{< example >}}
<div id="carouselExampleControlsNoTouching" class="carousel slide" data-ride="carousel" data-touch="false">
<div class="carousel-inner">
<div class="carousel-item active">
{{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#555" background="#777" text="First slide" >}}
</div>
<div class="carousel-item">
{{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#444" background="#666" text="Second slide" >}}
</div>
<div class="carousel-item">
{{< placeholder width="800" height="400" class="bd-placeholder-img-lg d-block w-100" color="#333" background="#555" text="Third slide" >}}
</div>
</div>
<a class="carousel-control-prev" href="#carouselExampleControlsNoTouching" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselExampleControlsNoTouching" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
{{< /example >}}

## Usage

### Via data attributes
Expand Down

0 comments on commit ba6182a

Please sign in to comment.