1

I have a three divs which slide in, they all have a z-order of 0, they can all slide in at different points and in different orders.

When then are all showing, how do I find out what order the divs are in, I want to be able to slide them back in with a delay on each.

Thanks

ojsglobal
  • 525
  • 1
  • 6
  • 31
  • 2
    Would you be able to post some code? – Joe Jun 09 '13 at 20:47
  • 2
    When you slide them in, why not just add a class (or other attribute) to them which deterministically defines their sequencing? Surely it isn't asynchronous or anything. – Eric Hotinger Jun 09 '13 at 20:49
  • 1
    Have a class and query by $(.className), which is in order! – cggaurav Jun 09 '13 at 20:49
  • Yeah, I could add a class, but then I'll need to start checking how many have been slid out previously - I really wanted to know if there was a sweet little jquery command to do the job. – ojsglobal Jun 09 '13 at 20:57
  • If you don't want to add the class, find some other way how to select them. Their order is equivalent to the order in which they appear in DOM so that will be it. – Erlik Jun 09 '13 at 20:57

1 Answers1

0

I guess your DIV's are slided in by a function of you or of jQuery. You can "override" this function. At this overriding you can put a mechanism that saves for example timestamp for the slided in DIV.

So you'll later be able to find out the order the div's have been shown in.

About overriding JavaScript-/jQuery-functions there are many good entries on Stackoverflow. For example: Override jQuery functions

Community
  • 1
  • 1
L. Monty
  • 872
  • 9
  • 17