[問題] 問一下JavaScript的問題(圖片移動)
<html>
<head>
<title>移動圖片</title>
<script language="JavaScript">
function moveImg()
{
myIMG.style.posLeft=myIMG.style.posLeft+10;
if(myIMG.style.posLeft>=850){
myIMG.style.posLeft=850;
myIMG.style.posTop=myIMG.style.posTop+5;
if(myIMG.style.posTop>=480) {
myIMG.style.posTop=480;
myIMG.style.posRight=myIMG.style.posRight+10;
if(myIMG.style.posRight>=800)
myIMG.style.posRight=800;
}
}
setTimeout("moveImg()",100)
}
</script>
</head>
<body background="bg01.jpg">
<img src="s3.gif" name="myIMG" width="100" height="100" style="position:absolute"onload="moveImg()">
</body>
</html>
這是我的程式碼
可以執行圖片先從左到右
再上到下
卻步能執行從右到左
請問要怎麼改呢
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 61.231.45.130
推
140.122.107.30 03/23, , 1F
140.122.107.30 03/23, 1F
→
140.122.107.30 03/23, , 2F
140.122.107.30 03/23, 2F
推
61.231.45.130 03/23, , 3F
61.231.45.130 03/23, 3F
推
140.109.175.155 03/25, , 4F
140.109.175.155 03/25, 4F
→
140.109.175.155 03/25, , 5F
140.109.175.155 03/25, 5F
→
140.109.175.155 03/25, , 6F
140.109.175.155 03/25, 6F
Web_Design 近期熱門文章
PTT數位生活區 即時熱門文章