Gallery image counter in jQuery swipebox plugin -



Gallery image counter in jQuery swipebox plugin -

i'm building custom image/video gallery swipebox plugin, need image/video counter , existing swipebox script doesn't provide that.

i image/video counter combined prev button can see when hovering have working.

i don't have fiddle, because have more css's , scripts separated made , don't know if work in fiddle.

here link , ignore big thumbnails in origin testing works don't have counter script.

can help me must easy.

from jquery.swipebox.js script can see counter should go:

<footer id="swipebox-bottom-bar">\ <ul>\ <li><a href="#" id="swipebox-prev" class="prev"><span>1/5</span></a> </li>\ <li><a href="#" id="swipebox-next">next</a> </li>\ </ul>\ </footer>\

well easiest way create changes straight in plugin code since info need there.

what did was

changed html template add together new ids counter. these ids used holders.

<footer id="swipebox-bottom-bar">\ <ul>\ <li> <a href="#" id="swipebox-prev" class="prev"> <span> <span id="swipebox-current-slide"></span>/ <span id="swipebox-all-slides"></span> </span> </a> </li>\ <li><a href="#" id="swipebox-next">next</a></li>\ </ul>\ </footer>\

in build function within method add together next line show total slide number

$('#swipebox-all-slides').text(elements.length);

note: add together after html appended body

in setslide function within method add together next line alter active slide number

$('#swipebox-current-slide').text(index + 1);

you can add together after line disabled class prev/next buttons removed.

you can test here (links in fiddle external; brake when page changes)

jquery

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -