Solved. Unfortunately also the object.rotation=1.5 works only once, so I've changed the puzzle to make my life more easy (no random, but four working keys)

Looking for a solution in internet, I've found this script made for CSS, I'm really interested in this workflow because I can set a value or condition only for one class(rotation) and link the object to his own script (with cycle puzzle, even if I create more scripts with different conditions, only the first works due to the tables. Well maybe I've done something wrong).
Maybe this script could be translated in Lua or maybe what I'm saying is really stupid, but who knows?
The script is made for various browser, but I'll put only the Firefox version:
Class definitions
.rotate0 {
transform: rotate(0deg); /* standard */
transform: rotate(0deg); /* Firefox */
.rotate90 {
transform: rotate(90deg);
.rotate180 {
transform: rotate(180deg);
.rotate270 {
transform: rotate(270deg);
Rotation with Javascript (JQuery) rotate 90 degrees every mouse click
$(document).ready( function() {
rotation_img = 0
$('#my-image').click( function() {
rotation_img += 90
$(this).attr('class', 'rotate' + rotation_img % 360 )
})
})
and here the link to the original page (sorry is in Italian)
http://www.simogrima.com/css/ruotare-immagini-attraverso-i-c...