1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
| <script type="text/javascript" src="mootools-1.3.js"></script>
<script type="text/javascript">
window.addEvent("domready",function() {
var cssPrefix = "";
switch(Browser.name) {
case "safari":
cssPrefix = "webkit";
break;
case "chrome":
cssPrefix = "webkit";
break;
case "firefox":
cssPrefix = "moz";
break;
case "opera":
cssPrefix = "o";
break;
case "ie":
cssPrefix = "ms";
break;
}
// Spin
if(cssPrefix) {
speed = 0.05;
(function() {
var rays = $("rays"), d = 0, dir = 1;
(function() {
d += speed * dir;
rays.set("style","-" + cssPrefix + "-transform:rotate(" + d + "deg)");
}).periodical(20);
})();
}
rays.addEvents({
mouseenter: function() { // 5x! Warp speed!
speed = 0.25;
},
mouseleave: function() { // Back to normal;
speed = 0.05;
}
});
});
</script> |
Partager