According to the Bootstrap 5 beta docs...
"Control and indicator elements must have a data-bs-target attribute
(or href for links) that matches the id of the .carousel element."
So I think only the Collapse component supports multiple targets. However, you can hook into the slide.bs.carousel
event of the 1st carousel to trigger slide on the 2nd carousel using javascript...
var carouselA = document.getElementById('carouselA')
var carouselB = document.getElementById('carouselB')
carouselA.addEventListener('slide.bs.carousel', function(e) {
var bsCarouselB = bootstrap.Carousel.getInstance(carouselB)
bsCarouselB.to(e.to)
})
Demo
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…