Building slider controls to target specific slides
I have a slider set up that navigates fine using 'next' and 'prev' buttons. There are 14 slides and I have 5 buttons at top that I need to point to specific slides in the layout. Content is static and there will always be 14 slides, and the links will always link to the same slide.
So I can manually set IDs for those slides and I can also manually designate each link to go to whatever slide... but I'm not sure how to move forward.
My existing slider code is very basic:
- $("#slider").cycle({
- fx: 'scrollHorz',
- timeout: 0,
- next: '.next',
- prev: '.prev',
- });
... and the layout code is also pretty basic (obviously not semantically correct, just so you have an idea):
- <div#wrapper>
- <div#navlinks>
- <a href="#linktoslide1"></a>
- <a href="#linktoslide4"></a>
- <a href="#linktoslide7"></a>
- </navlinks>
- <a class="prev"></a>
- <a class="next"></a>
- <div#slider>
- <div#slide1></div>
- <div#slide2></div>
- <div#slide3></div>
- <div#slide4></div>
- <div#slide5></div>
- <div#slide6></div>
- <div#slide7></div>
- </slider>
- </wrapper>
So, the slider is working great. I just need to create navigation that allows a few links to point to specific slides here.