这是应该完成您需要样式表任务的代码:您需要编写样式/图像等
<style type="text/css">
.step00{background:#000000;} /*this is the initial background when page loaded*/
.step01{background:#454545;} /*First change after 1 sec*/
.step02{background:#333333;} /*2nd change after 2 sec*/
.step03{background:#234567;} /*3rd change after 3 sec*/
.step04{background:#789564;} /*4th change after 5 sec*/
.step05{background:#cccccc;} /*5th change after 5 sec*/
.stepfixed{background:#fff222;} /*final definitive bg after 6 sec*/
</style>
html
<div id="plateau" class="step00">
<div id="plateau-fond">
<script type="text/javascript">
var count = 0;
jQuery(window).load(function () {
var interval = window.setInterval("change_bg()",1000); //1000 = 1sec here
});
function change_bg() {
jQuery('div#plateau').removeClass('step0'+count);
count++;
if(count > 5) {
jQuery('div#plateau').addClass('stepfixed');
window.clearInterval(interval);
} else {
jQuery('div#plateau').addClass('step0'+count);
}
}
</script>
***上面的代码需要 Jquery 才能工作。不要忘记包含 jquery。包含 jquery 非常简单。如果您不能这样做,请发表评论。