Hello,
I'm sure the solution is easy but can't find it, so thanks for your help.
Here is my issue : I have a board on which I put cards. Then the player must be able to select the cards.
globaly the tpl is like :
<div id="places_up">
-- div of the cards to be placed here (generated in js) -- (2 divs)
</div>
<div id="places_left">
-- div of the cards to be placed here (generated in js) --(2 divs)
</div>
<div id="places_right">
-- div of the cards to be placed here (generated in js) --(2 divs)
</div>
On the contained div (the cards), I applied a CSS "hover" and a js onclick() handler
Css for places_up, places_left, places_right are mostly the same (containing only "top" and "left" attributes),
except that for places_right and places left, I applyed a css transform "rotate" of 120 deg (because the board is set so that the set of cards is turned)
It seems that applying the "rotate" transformation make contained div "hover" and "onclick()" not applicable -they don't work after rotate operation-, as the same operation works well for places_up but not for places_right and places_left (except if I remove the transform: rotate operation)
Do you have any solution to this?
Thanks
---- For the moment, I have solutions that are mostly just hiding the problem, I want to avoid this, but there they are : ----
1) transform the board to have no rotation of the card. This is less looking like the original game, but at least this works well, and keep playability
2) create a svg polygon in a separate div for each cards, and then apply the hover and "onclick" on it. I am sure I can work it out but for the moment doing so it destroy the global layout. Still, I think that is the best "hiding problem" solution if I can't work it out more properly.
I'm sure the solution is easy but can't find it, so thanks for your help.
Here is my issue : I have a board on which I put cards. Then the player must be able to select the cards.
globaly the tpl is like :
<div id="places_up">
-- div of the cards to be placed here (generated in js) -- (2 divs)
</div>
<div id="places_left">
-- div of the cards to be placed here (generated in js) --(2 divs)
</div>
<div id="places_right">
-- div of the cards to be placed here (generated in js) --(2 divs)
</div>
On the contained div (the cards), I applied a CSS "hover" and a js onclick() handler
Css for places_up, places_left, places_right are mostly the same (containing only "top" and "left" attributes),
except that for places_right and places left, I applyed a css transform "rotate" of 120 deg (because the board is set so that the set of cards is turned)
It seems that applying the "rotate" transformation make contained div "hover" and "onclick()" not applicable -they don't work after rotate operation-, as the same operation works well for places_up but not for places_right and places_left (except if I remove the transform: rotate operation)
Do you have any solution to this?
Thanks
---- For the moment, I have solutions that are mostly just hiding the problem, I want to avoid this, but there they are : ----
1) transform the board to have no rotation of the card. This is less looking like the original game, but at least this works well, and keep playability
2) create a svg polygon in a separate div for each cards, and then apply the hover and "onclick" on it. I am sure I can work it out but for the moment doing so it destroy the global layout. Still, I think that is the best "hiding problem" solution if I can't work it out more properly.