1
我是javascript新手。使用JavaScript或jQuery創建序列步驟[動畫]
我想創建一些序列動作,一步一步來。 因此,假設我有10S下面這個網站時間軸介紹:
步驟
- 展會標誌
- 顯示網站名稱
- 顯示我的名字
- 和許多許多其他行爲....
這是我嘗試
<script type="text/javascript">
var bod = document.getElementById("_8d4a");
var preTag = document.getElementById("style-text");
var stand = document.getElementById("standby");
setTimeout(function(){ bod.style.backgroundColor = "#000" }, 3000);
setTimeout(function(){ preTag.style.left = "500px" }, 7000);
setTimeout(function(){ preTag.style.left = "100px" }, 8000);
setTimeout(function(){ bod.style.backgroundImage = "url('index.jpg')" }, 7000);
setTimeout(function(){ bod.style.fontSize = "5em" }, 7000);
setTimeout(function(){ bod.style.backgroundImage = "url('index1.jpg')" }, 7300);
setTimeout(function(){ bod.style.fontSize = "1em" }, 7400);
setTimeout(function(){ stand.style.display = "block" }, 7600);
setTimeout(function(){ bod.style.backgroundImage = "url('No_signal.gif')" }, 7600);
setTimeout(function(){ stand.style.display = "none" }, 8500);
setTimeout(function(){ bod.style.backgroundImage = "none" }, 8500);
</script>
,也是我知道我可以使用jQuery寫像這樣:
$(".a").fadeIn(3000,function(){
$(".b").fadeIn(4000, function(){
$(".c").fadeIn(5000);
});
});
但在那裏做這些動作的任何更好的方法,更清潔?