dimsemenov / PhotoSwipe

JavaScript image gallery for mobile and desktop, modular, framework independent
http://photoswipe.com
MIT License
23.99k stars 3.32k forks source link

counter leading 0 #2108

Open Diemsy opened 2 weeks ago

Diemsy commented 2 weeks ago

Good morning Thank you first of all for this wonderful plugin which allows me to do what I want on my project. I would like to know if it is possible to modify the counter so that it displays 01/10 rather than 1/10? I've done a lot of research but haven't seen anything in this direction. Thanks in advance

dimsemenov commented 2 weeks ago

You may disable the default indicator (via option counter:false). And implement your own.

How to add own element: https://photoswipe.com/adding-ui-elements/

Source of the default counter: https://github.com/dimsemenov/PhotoSwipe/blob/master/src/js/ui/counter-indicator.js