How to change two div positions on click using javascript

I got a web page with some "maps" (divs). they are arranged in a star-like pattern in the background.

I want to bring cards from the background to the background by clicking on it (for example, to focus the card "contact").

how can i figure it out? is there a script that already contains such a function?

+2


a source to share


2 answers


I believe the CSS z-index

property is what you want to use, but I haven't used it, so I can't help there.



0


a source


You can use z-index, but: You should be aware of this. If the user wants to cheat, he can just go with firebug and start changing z-indices to change the map positions.



Perhaps you shouldn't have all the cards in there and just keep changing the top card image to a new one. instead of having all of them from the start. Also, since you have so many card divisions that you don't need, you can always see one or two.

0


a source







All Articles