我正在努力讓「C22RJC」會下降,「SOPOET」會上升。我想讓他們在中間相遇並且拼出「CS202Project」這個詞,我不知道如何讓這些文字在中間相遇並且拼出單詞。移動圖像塊
這裏是我到目前爲止的代碼:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script>
var TopPost = 0;
var BottPost = 79;
var Move = new Array(80);
for(var i = 0; i < 80; ++i) {
Move[i] = TopPost;
TopPost += 5;
for(var i = 80; i < 80; --i) {
Move[i] = BottPost;
BottPost -= 5;
function TopSec(){
document.getElementById("top") = Move[TopPost] + "px";
}
function BottSec(){
document.getElementById("bottom") = Move[BottPost] + "px";
}
function startMov(){
setInterval("TopSec()", 1000);
setInterval("BottSec()", 1000);
}
</script>
</head>
<body>
<span id="top">
<center>
<image src="Images/C.jpeg" height="50">
<image src="Images/2.jpeg" height="50">
<image src="Images/2.jpeg" height="50">
<image src="Images/R.jpeg" height="50">
<image src="Images/J.jpeg" height="50">
<image src="Images/CC.jpeg" height="50">
</center>
</span>
<span id="bottom" style="position: fixed; bottom: 0; width: 100%">
<center>
<image src="Images/S.jpeg" height="50">
<image src="Images/0.jpeg" height="50">
<image src="Images/P.jpeg" height="50">
<image src="Images/O.jpeg" height="50">
<image src="Images/E.jpeg" height="50">
<image src="Images/T.jpeg" height="50">
</center>
</span>
<span id="year">
<image src="Images/2015.jpeg" height="50">
</span>
</body>
</html>
我可能會問你爲什麼不使用CSS來做到這一點? – JosephMCasey
我被要求使用javascript –
你的老師是否告訴你使用'