2
0
mirror of https://github.com/tenrok/bootstrap.git synced 2026-06-14 18:42:30 +03:00

docs: switch to fenced codeblocks (#31806)

This commit is contained in:
XhmikosR
2020-10-19 12:56:49 +03:00
committed by GitHub
parent 48177c946f
commit e6618a6ebb
43 changed files with 494 additions and 446 deletions
+6 -6
View File
@@ -263,10 +263,10 @@ The `data-ride="carousel"` attribute is used to mark a carousel as animating sta
Call carousel manually with:
{{< highlight js >}}
```js
var myCarousel = document.querySelector('#myCarousel')
var carousel = new bootstrap.Carousel(myCarousel)
{{< /highlight >}}
```
### Options
@@ -330,13 +330,13 @@ Options can be passed via data attributes or JavaScript. For data attributes, ap
You can create a carousel instance with the carousel constructor, for example, to initialize with additional options and start cycling through items:
{{< highlight js >}}
```js
var myCarousel = document.querySelector('#myCarousel')
var carousel = new bootstrap.Carousel(myCarousel, {
interval: 2000,
wrap: false
})
{{< /highlight >}}
```
<table class="table">
<thead>
@@ -411,13 +411,13 @@ All carousel events are fired at the carousel itself (i.e. at the `<div class="c
</tbody>
</table>
{{< highlight js >}}
```js
var myCarousel = document.getElementById('myCarousel')
myCarousel.addEventListener('slide.bs.carousel', function () {
// do something...
})
{{< /highlight >}}
```
### Change transition duration