malsup / cycle2

2nd gen cycling
899 stars 239 forks source link

Cycle2 initalization order with hashes #781

Open figarowho opened 8 years ago

figarowho commented 8 years ago

I have a page where I am using the hash to change images in a slider. The code is generating great, but when cycle2 initializes... it is often out of order. The console log shows this best. For example:

First time refreshing: [cycle2] [0] hash: layers-darner(1) (string) [cycle2] [1] hash: 2049-2(3) (string) [cycle2] [2] hash: layers-blue-wings(2) (string) [cycle2] [3] hash: layers-meadowhawks(4) (string) [cycle2] [4] hash: fragments-from-my-diary(0) (string) [cycle2] [5] hash: layers-beetles(5) (string) [cycle2] [6] hash: life-cycle-from-notes-on-the-state-of-virginia(7) (string) [cycle2] [7] hash: layers-nest(6) (string) [cycle2] [8] hash: life-cycle(8) (string)

Second time refreshing: [cycle2] [0] hash: fragments-from-my-diary(0) (string) [cycle2] [1] hash: layers-darner(1) (string) [cycle2] [2] hash: layers-blue-wings(2) (string) [cycle2] [3] hash: layers-meadowhawks(4) (string) [cycle2] [4] hash: layers-beetles(5) (string) [cycle2] [5] hash: 2049-2(3) (string) [cycle2] [6] hash: layers-nest(6) (string) [cycle2] [7] hash: life-cycle-from-notes-on-the-state-of-virginia(7) (string) [cycle2] [8] hash: life-cycle(8) (string)

It doesn't seem to matter if I put the cycle2 code in the header or the footer. I still get a random ordering each time. Of course, I do not have random set to true.

Any ideas of how I can make the order consistent... ie, in order?

Thanks,

Jonathan