question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Carousel Navigation - Help

See original GitHub issue

Hello ı have been trying to navigate carousel from outside of .carousel-indicatiors.

since in bootstraps code i can make it with defining “data-to-slide” atr.

https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_carousel&stacked=h <li data-target="#myCarousel" data-slide-to="0" class="active"></li> <li data-target="#myCarousel" data-slide-to="1"></li> <li data-target="#myCarousel" data-slide-to="2"></li>

I couldnt make it work for bootstrap-vue. i tried to define all aria labels on extrenal <li aria-*> but no navigation happening.

I have a seperate/secondary navigation on my page apart from carousel but needs to navigate carousel slider too.

This navigation outside of the div of #carousel and have to navigate carousel slides as indicators.

I am using bundler, tried vue-webpack-simple and advanced so far for compat. issues bu no help so far.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

3reactions
tmorehousecommented, Jul 26, 2017

Try this:

this.$refs.myCarousel.index = n or @click="$refs.myCarousel.index = n"

where n is the slide you want to go to.

Note if the carousel is in the middle sliding when you specify the new index, it will not slide to that slide.

3reactions
tmorehousecommented, Jul 26, 2017

The aria labels are for labelling the controls for sight impaired users that are using a screen reader to describe the page layout and controls.

Bootstrap-Vue components do not look outside of their own DOM section, and hence do not look for any of the bootstrap V4 jQuery data-* interface (i.e. data-target, data-slide-to, data-toggle, etc.).

Currently carousel doesn’t provide a v-model binding for setting the current slide.

You can get around this and control the next and previous side by setting a ref="myCarousel" attribute on <b-carousel ref="mycarousel"> and then calling the next() and previous() methods on that ref:

// Goto next slide
 this.$refs.myCarousel.next();
// Goto previous slide
 this.$refs.myCarousel.prev();

I have created a PR to add support for controlling the slide number via a v-model binding.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Carousels Tutorial | Web Accessibility Initiative (WAI) - W3C
Accessible carousels are essential for many website users including: People using keyboard navigation and voice input software can navigate between individual ...
Read more >
Best practices for carousels - web.dev
A carousel is a UX component that displays content in slideshow-like manner. Carousels can "autoplay" or be navigated manually by users.
Read more >
5 Website Carousel Best Practices to Enhance Your Sliders ...
Now, let's review some website carousel best practices to help you do just that ... The most common types of website carousel navigation...
Read more >
Carousel/slider design best practices (with examples) - Webflow
Find out when, where, and how website carousels/sliders work best in web design — and when you shouldn't use them at all.
Read more >
Carousel Usability: Designing an Effective UI for Websites with ...
5. Ensure that navigation controls appear inside the carousel, not below it or separated by a fold. ... This design practice helps avoid...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found