On 4/15/07, boermans <[EMAIL PROTECTED]> wrote:
Hi all,
I'm attempting to write a script which makes changes to image
positioning depending on attributes of previous images within a
portion of a document. To do so I'm looking for a way to select the
previous image relative to each image in the order in which they
appear in the document.
Using .prev() would make this simple if the images were all in the one
paragraph. Some are, some not. Regardless, for each image in turn, I
want to check certain attributes of the previous image.
Thanks in advance for your ideas!
Hmm, Check the examples in the API under each() and $.each()
You could go through them when the page loads and give an incremental
attribute like "index". Then when do your script, you get the current
index, subtract 1, then find the item with that new index. $("[EMAIL
PROTECTED]"
+ newIndex + "]").dosomeething();
Might be a better way, but this would work.
Glen