Hi all,

I'm working on an interface with two different chains of animations.
The page shows 5 pets and allows the user to click on one of them for
details. When one is clicked, the other pets disappear, the selected
one's image slides to the left and the content appears. When the image
is clicked again, the reverse happens, the content disappears, the
image slides back into its original position, and the other pets
appear again.

I decided to implement the code for this as a plugin, which I'm
calling "Pick An Item," as an exercise in both writing a plugin and
abstracting code. Everything is working as expected except for one
issue I haven't been able to figure out. After you've gone through a
full cycle of selecting/deselecting a pet, the next time you select
that same pet, when it gets to the point where the content should
appear, it doesn't. Further clicks on the selected pet do not reverse
the effect like they should. Each individual pet works correctly for
one open/close cycle but then fails for subsequent opens. I've gone
over and over it and I don't see what's different between the initial
state of the page/script and the state after an open/close cycle has
finished.

This is my first attempt at writing a plugin so no doubt a lot of it
can be done better/more simply, but I'm hoping someone can make sense
of what I've written and see where I'm getting tripped up.

I've put the page online so you can see it in action: 
http://www.minibontown.com/dev/
and for your convenience, here is the plugin code in a pastebin:
http://pastie.org/580152

Line 73 is where it fails. That call seems to have no effect the
second time through.

Thanks in advance for any help anyone can provide!

Reply via email to