javascriptjqueryhtmlcamerajquery-slider

Pagination function in custom href link for camera slider


I'm using Camera Slider. The slider has 3 images that will be automatically sliding.

And I added 3 links out of the slider that positioned with css. Here is my html structure

<div class="custom-navigation">
  <a href="#">Slide1</a>
  <a href="#">Slide2</a>
  <a href="#">Slide3</a>
</div>

What I need Exactly

I need to change slider images when user click on the each links, like slider pagination. simply means when a user click on the Slide1 <a href="#">Slide1</a> the slider shows first slider image and respectively. So how can I give the pagination function to custom href link.

Code Demo Here - CodePen


Solution

  • $('.custom-navigation a').click(function(){
        $('.camera_pag_ul li').eq( $(this).index() ).click();
    });
    

    Just pass the 'click to correspond pagination link' when you click on custom link