5
https://fiddle.jshell.net/sLa0q4yh/
This example above is not yet fully functional, the logic of the puzzle is:
1 - Click on at least two Ivs (or 2 pieces of the puzzle) and so both Ivs would have to switch places using animation.
2 - For this to occur, I collected with the offset of jquery, the top and left position, both of the first and second piece of the puzzle clicked.
3 - But when using the Animate() (to make the animation of the swap of parts) nothing is happening, they remain in the same place.
What can be done in this case?
Grateful
Dude, we missed the
cont++
on top of your firstif
. It is not adding counter in variable, so it never enters usifs
.– Diego Souza
And it won’t work with
position: relative
.– Diego Souza
It’s true I forgot to transcribe that part, but I’ve updated, but the animation isn’t going to the right place yet. Thank you for verifying the error. https://fiddle.jshell.net/sLa0q4yh/1/
– user31050
You’re not going because you’re with
position: relative
. See, as I did inabsolute
. https://fiddle.jshell.net/sLa0q4yh/3/, but all the layout goes.– Diego Souza
I noticed, it’s getting in total clutter in the container. What do you think can be done there ?
– user31050