我使用下面的代码来重复 CSS 转换,但它不会工作!
for (var i=0 ; i<4 ; i++){
setTimeout(function() {
$('#top-left').css('margin', '45px 0 0 45px');
$('#top-mid').css('margin', '45px 0 0 90px');
$('#top-right').css('margin', '45px 0 0 135px');
$('#mid-right').css('margin', '90px 0 0 135px');
$('#bot-right').css('margin', '135px 0 0 135px');
$('#bot-mid').css('margin', '135px 0 0 90px');
$('#bot-left').css('margin', '135px 0 0 45px');
$('#mid-left').css('margin', '90px 0 0 45px');
}, 4500);
setTimeout(function() {
$('#top-left').css('margin', '180px 0 0 180px');
$('#top-mid').css('margin', '180px 0 0 90px');
$('#top-right').css('margin', '180px 0 0 0');
$('#mid-right').css('margin', '90px 0 0 0');
$('#bot-right').css('margin', '0 0 0 0');
$('#bot-mid').css('margin', '0 90px 0 90px');
$('#bot-left').css('margin', '0 180px 0 180px');
$('#mid-left').css('margin', '90px 0 0 180px');
}, 9000);
};