View Full Version : Help with counting in reverse order.

08-06-2008, 08:42 PM
Hello. I am working snippet of js that controls a photo galleries count is 1 of 8.

Thing is I can't get this to count backwards. I can make it count from -8 to -1, but that's not what I am trying to do.

I am trying it to start on image 8 of 8 in the gallery and as I progress through the number subtracts 1 or just counts in reverse until I arrive at image 1 of 8.

Is there a clear way to achieve this with out breaking this code?

if(this.mode == 'imageGallery'){
this.count.appendText((this.currentIndex+length-9)+' of '+this.currentGallery.length);

08-07-2008, 05:29 AM
Do you by chance could provide a link.

08-07-2008, 05:02 PM
I don't have the code online. Sry.

08-07-2008, 07:32 PM
This will get you started

function count_down(arr){

I'm not positive about what you want to do, so I couldn't add more, but this loop will count down for you.