Bootstrap Carousel
- Started
- Last post
- 7 Responses
- Maaku
How do I connect thumbnails from a page to specific slides in the carousel?
My problem is that the thumbnails and the carousel are not on the same page.
- mikotondria30
Give us some codez ?
- Maaku0
Of course, this would be the html code for the navigation:
<ul id="carousel-nav">
<li><a href="#my-carousel" data-to="1" >Slide 1</a></li>
<li><a href="#my-carousel" data-to="2" >Slide 2</a></li>
<li><a href="#my-carousel" data-to="3" >Slide 3</a></li>
</ul>and this is the JS for the carousel:
$('#carousel-nav a').click(function(q){
q.preventDefault();
targetSlide = $(this).attr('data-to')-1;
$('#my-carousel').carousel(targe...
});The thing is that right now the code works if the thumbnails and carousel are on the same page but I have no idea how to make it work if the thumbnails are on page 1 and the carousel on page 2.
- Hue0
Does this help? http://bootsnipp.com/snipps/caro…
- Maaku0
^ I will give it a try later on today, THANKS!
- Maaku0
That bootsnipp works perfectly if I have everything on the same page. I can't get it to work if my thumbnails and slider are in separate pages.
I am using hashes for the URLs like this:
"mySlidePage.html#slide3"and
$(document).ready(function(){
var slideNumber= window.location.hash.replace('#s...
$('a.panel-open').eq( slideNumber).trigger('click')// this assumes you have an a.panel-open for each image})
- Clicking any thumbnails still takes me to the first slide of the carousel :(Maaku
- bklyndroobeki0
bump.
anything new since Mar 2013? looking for a good one.
- bklyndroobeki0
fine.