Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You can have the current slide no as <code>current_slide_no = jQuery('#nivo-slider').data('nivo:vars').currentSlide;</code> Add 1 to it as index starts from 0.</p> <p>Use <code>afterChange</code> attribute to change the current slide number while initializing the NIVO slider.</p> <p>So, I got it working by</p> <pre><code>&lt;script type="text/javascript"&gt; jQuery(document).ready(function(){ var total = jQuery('#nivo-slider img').length; var current_slide_no = 1; // garbage // var rand = Math.floor(Math.random()*total); jQuery('#nivo-slider').nivoSlider({ effect:'fade', //Specify sets like: 'fold,fade,sliceDown,slideInLeft' animSpeed:600, //Slide transition speed pauseTime:30000, directionNav:false, //Next and Prev // directionNavHide:true, //Only show on hover controlNav:true, //1,2,3... controlNavThumbs:true, //Use thumbnails for Control Nav controlNavThumbsFromRel:true, //Use image rel for thumbs pauseOnHover:false, //Stop animation while hovering //captionOpacity:0.3, //Universal caption opacity startSlide:0, //Set starting Slide (0 index) // keyboardNav:true //Use left and right arrows afterChange: function(){ current_slide_no = jQuery('#nivo-slider').data('nivo:vars').currentSlide; jQuery('#nivo-slider-status &gt; .current-slide').html(current_slide_no+1); } }); jQuery('#nivo-slider-status').show(); jQuery('#nivo-slider-status &gt; .total-slides').html(total); current_slide_no = jQuery('#nivo-slider').data('nivo:vars').currentSlide; jQuery('#nivo-slider-status &gt; .current-slide').html(current_slide_no+1); }); &lt;/script&gt; </code></pre> <p>and my html (should be outside the NIVO slider DIV) is</p> <pre><code>&lt;div id="nivo-slider-status" class="alignright"&gt; &lt;span class="current-slide"&gt;&lt;/span&gt; of &lt;span class="total-slides"&gt;&lt;/span&gt; &lt;/div&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload