Sto cercando di trovare una soluzione cross-browser per questo effetto, ma questo è il meglio che sono riuscito a trovare:Endlessly filatura immagine/div (cross-browser)
E 'anche molto favorevole alla CPU.
Alcune soluzioni javascript non cross-browser utilizzano quasi il 50% di CPU. A mio parere, questa non è una soluzione per l'uso web.
L'esempio fornito funziona in Chrome 17, Firefox 11 e Safari 5.1.7.
Quindi la mia domanda è: esiste un modo per creare questo effetto (senza flash o java ovviamente) quindi funzionerebbe anche in Opera e IE?
EDIT:
HTML
<div id="starholder">
<div id="star"></div>
</div>
CSS
@-webkit-keyframes spin {
from { -webkit-transform: rotate(0deg); }
to { -webkit-transform: rotate(360deg); }
}
@-moz-keyframes spin {
from { -moz-transform: rotate(0deg); }
to { -moz-transform: rotate(360deg); }
}
@-ms-keyframes spin {
from { -ms-transform: rotate(0deg); }
to { -ms-transform: rotate(360deg); }
}
#starholder {
position: relative;
width: 400px;
height: 400px;
margin: 100px 0 0 100px;
}
#star {
background: url(http://3.bp.blogspot.com/__RwzDZn-SJM/RoEJcKxDs6I/AAAAAAAAAAQ/XYAyhQG2kcw/s320/hypnosis.gif) 0 0 no-repeat;
position: absolute;
top: -100px;
left: -100px;
width: 320px;
height: 320px;
-webkit-animation-name: spin;
-webkit-animation-duration: 12000ms;
-webkit-animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
-moz-animation-name: spin;
-moz-animation-duration: 12000ms;
-moz-animation-iteration-count: infinite;
-moz-animation-timing-function: linear;
-ms-animation-name: spin;
-ms-animation-duration: 12000ms;
-ms-animation-iteration-count: infinite;
-ms-animation-timing-function: linear;
}
Inserisci il tuo codice nella tua domanda. Non puoi fare affidamento esclusivamente su un collegamento Fiddle. –
Se aggiungi '-o-keyframes' e' -ms-keyframes' otterrai un supporto Opera (non sono sicuro dei numeri di versione esatti) e supporto per IE 10, almeno :) – Ryan
@minitech: Potrebbe fornisci un esempio per favore? –