2
一個例子上的jsfiddle http://jsfiddle.net/chrisloughnane/T9N3h/IE9瀏覽器是否存在CSS「轉換」?
這個例子正常工作在Opera,Chrome和Firefox,但我無法找到IE的變換。
同樣在Firefox上,當有很多轉換時,所有動畫都會停止。
http://toys.chrisloughnane.net/
有沒有更好的方式來處理呢? TIA。
HTML
<div class="display"></div>
CSS
.display {
background-image: url("http://toys.chrisloughnane.net/images/darkhand-small-50.png");
height: 25px;
width: 25px;
-webkit-transition:all 400ms;
-moz-transition:all 400ms;
-o-transition:all 400ms;
transition:all 400ms;
position: absolute;
top: 200px;
left: 200px;
}
的JavaScript
$(document).ready(function() {
function getRandom(min, max) {
return min + Math.floor(Math.random() * (max - min + 1));
}
function go() {
var iCSS = ("rotate(" + getRandom(0, 359) + "deg)");
$(".display").css({
'-moz-transform': iCSS,
'-o-transform': iCSS,
'-webkit-transform': iCSS
});
setTimeout(go, 600);
}
go();
});
更好的網址:http://caniuse.com/transforms2d(更多信息) – 2013-03-03 21:08:57