The amount of time to delay between automatically cycling an item. If false, carousel will not automatically cycle.
keyboard
boolean
true
Whether the carousel should react to keyboard events.
pause
string | boolean
"hover"
If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. If set to false, hovering over the carousel won't pause it.
On touch-enabled devices, when set to "hover", cycling will pause on touchend (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.
ride
string
false
Autoplays the carousel after the user manually cycles the first item. If "carousel", autoplays the carousel on load.
wrap
boolean
true
Whether the carousel should cycle continuously or have hard stops.
Methods
Asynchronous methods and transitions
All API methods are asynchronous and start a transition. They return to the caller as soon as the transition is started but before it ends. In addition, a method call on a transitioning component will be ignored.
Cycles the carousel to a particular frame (0 based, similar to an array). Returns to the caller before the target item has been shown (i.e. before the slid.bs.carousel event occurs).
特定のアイテムにスライドします。
.carousel('prev')
前のアイテムにスライドします。
.carousel('next')
次のアイテムにスライドします。
.carousel('dispose')
アイテムを破棄します。
Events
カルーセルの機能を操作するための2つのイベントがあります。
direction: スライドされる方向
relatedTarget: アクティブなアイテムとして配置するDOM要素
from: 現在のアイテムのindex
to: 次のアイテムのindex
Event Type
Description
slide.bs.carousel
This event fires immediately when the slide instance method is invoked.
slid.bs.carousel
This event is fired when the carousel has completed its slide transition.
Change transition duration
The transition duration of .carousel-item can be changed with the $carousel-transition Sass variable before compiling or custom styles if you’re using the compiled CSS. If multiple transitions are applied, make sure the transform transition is defined first (eg. transition: transform 2s ease, opacity .5s ease-out).