Ninja Slider / Posts /

How to get image numbers outside slider

0

Hi there,

I want to have the current image slide number displayed below the slider - in the format "2/15" ... "3/15" etc. How can I do this please?


Many thanks,

Matt

Matt Harwood  8 years ago   viewed: 2828    

3 Answers

0

You can modify the nsOptions in the ninja-slider.js:

var nsOptions = { ...... before: function (currentIdx, nextIdx, manual) { var sliderCount = document.getElementById(“sliderCount”); sliderCount.innerHTML = (nextIdx + 1 )+ "/" + nslider.getSlides().length; }, ...... }

For details please read the "Built-in event handlers and functions" section on the page Ninja Slider.

Milo   8 years ago
0
Milo,

Thank you very much for your help. However, I have added a span with the id sliderCount, and adjusted my nsOptions as shown below, but now no slideshow appears at all. Any ideas please?


var nsOptions =
{
    sliderId: "ninja-slider",
    transitionType: "slide", //"fade", "slide", "zoom", "kenburns 1.2" or "none"
    autoAdvance: false,
    delay: "default",
    transitionSpeed: "default",
    aspectRatio: "4:3",
    initSliderByCallingInitFunc: false,
    shuffle: false,
    startSlideIndex: 0, //0-based
    navigateByTap: true,
    pauseOnHover: false,
    keyboardNav: true,
    before: function (currentIdx, nextIdx, manual) {
                var sliderCount = document.getElementById(“sliderCount”);
        sliderCount.innerHTML = (nextIdx + 1 )+ "/" + nslider.getSlides().length;
           },
    license: "XXXXXX"
   
};

Thank you again,
Matt


Matt Harwood   8 years ago
0

Would you stage a testing page and share the page URL?

Milo   8 years ago

   

Your name*
Password
(Optional. Used to modify this post afterwords)
+ =  

Ask your Own Question

  • If your question is related to the topic of this post, you can post your question to this page by clicking the "Post a reply" button at left;

  • When you want to start a new page for your question: