slitslider.js - open a specific div, not with arrow

Viewed 24

I'm using Slit Slider js. This opens div slides with arrows and dots for navigation. Is there a way to create a link to open a specific slide? For example: Home, About Us etc. instead of arrows.

<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
$(function() {
  var Page = (function() {
    var $navArrows = $('#nav-arrows'),
      $nav = $('#nav-dots > span'),
      slitslider = $('#slider').slitslider({
        onBeforeChange: function(slide, pos) {
          $nav.removeClass('nav-dot-current');
          $nav.eq(pos).addClass('na```v-dot-current');
        }
      }),
      init = function() {
        initEvents();
      },
      initEvents = function() {
        // add navigation events
        $navArrows.children(':last').on('click', function() {
          slitslider.next();
          return false;
        });

        $navArrows.children(':first').on('click', function() {
          slitslider.previous();
          return false;
        });

        $nav.each(function(i) {
          $(this).on('click', function(event) {
            var $dot = $(this);
            if (!slitslider.isActive()) {
              $nav.removeClass('nav-dot-current');
              $dot.addClass('nav-dot-current');
            }
            slitslider.jump(i + 1);
            return false;
          });
        });
      };
    return {
      init: init
    };
  })();

  Page.init();
});

Thanks for your support :)

0 Answers
Related