The animation that is supposed to run on document load runs every time the link is clicked.
I have tried applying .stop(), .stopPropagation(), and .stopImmediatePropagation() chained on to the last line of code. None of them work. The bit of code always repeats the animation requested in the document ready section. I can't figure out why it executes again the contents of the document ready code after it runs the click function on the last line.
I want to say, run animation first, and not again unless asked. And after the animation, if the client clicks on a link, make the given change in the css value z-index for that image.
What it does is run the animation, then if I click a link, it makes the appropriate css change, and immediately re-runs the animation. I don't want it to re-run the animation.
Also, I am doing everything on $("div.box"), but don't want to keep recreating that object. But I haven't been able to save that object to a variable for reuse, and have the initial animation still work.
Please help.