Whether the carousel should support left/right swipe interactions on touchscreen devices.Īll API methods are asynchronous and start a transition. Whether the carousel should cycle continuously or have hard stops. If "carousel", autoplays the carousel on load. Note that this is in addition to the above mouse behavior.Īutoplays the carousel after the user manually cycles the first item. 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. If set to false, hovering over the carousel won't pause it. If set to "hover", pauses the cycling of the carousel on mouseenter and resumes the cycling of the carousel on mouseleave. Whether the carousel should react to keyboard events. If false, carousel will not automatically cycle. The amount of time to delay between automatically cycling an item. For data attributes, append the option name to data-, as in data-interval="". Options can be passed via data attributes or JavaScript. Via JavaScriptĬall carousel manually with: $ ( '.carousel' ). It cannot be used in combination with (redundant and unnecessary) explicit JavaScript initialization of the same carousel. If you don’t use data-ride="carousel" to initialize your carousel, you have to initialize it yourself. The data-ride="carousel" attribute is used to mark a carousel as animating starting at page load. Alternatively, use data-slide-to to pass a raw slide index to the carousel data-slide-to="2", which shifts the slide position to a particular index beginning with 0. data-slide accepts the keywords prev or next, which alters the slide position relative to its current position. Use data attributes to easily control the position of the carousel. Placeholder Third slide Previous Next Previous Next Usage Via data attributes carousel-item to change the amount of time to delay between automatically cycling to the next item. carousel-item intervalĪdd data-interval="" to a. Placeholder Third slide Previous Next Previous Next Individual. carousel-fade to your carousel to animate slides with a fade transition instead of a slide. Third slide label Praesent commodo cursus magna, vel scelerisque nisl consectetur. Second slide label Lorem ipsum dolor sit amet, consectetur adipiscing elit. Previous Next First slide label Nulla vitae elit libero, a pharetra augue mollis interdum. Praesent commodo cursus magna, vel scelerisque nisl consectetur. d-none and bring them back on medium-sized devices with. They can be easily hidden on smaller viewports, as shown below, with optional display utilities. Placeholder Third slide Previous Next Previous Next With captionsĪdd captions to your slides easily with the. w-100 on carousel images to prevent browser default image alignment. Control and indicator elements must have a data-target attribute (or href for links) that matches the id of the. carousel for optional controls, especially if you’re using multiple carousels on a single page. active class needs to be added to one of the slides otherwise the carousel will not be visible. While carousels support previous/next controls and indicators, they’re not explicitly required. As such, you may need to use additional utilities or custom styles to appropriately size content. ExampleĬarousels don’t automatically normalize slide dimensions. Lastly, if you’re building our JavaScript from source, it requires util.js. Please be aware that nested carousels are not supported, and carousels are generally not compliant with accessibility standards. See the reduced motion section of our accessibility documentation. The animation effect of this component is dependent on the prefers-reduced-motion media query.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |