[問題] if設置
<!-- 讓東西掉下來 -->
<img id="bigStone" src="4.jpg" style="width:5em; height:5em; position:
relative;">
<script type="text/javascript">
var stone = document.getElementById("bigStone");
function comedown() {
var posDown = parseInt(stone.style.bottom).toString() == "NaN" ? 0 :
parseInt(stone.style.bottom);
stone.style.bottom = (posDown - 1) + "px";
if (parseInt(stone.style.top) == (plane.style.height)) {
clearInterval(stone);
stone.style.top = "0px";
}
setInterval("comedown()", 10);
</script>
<-- plane是另一張圖片 -->
扣除if那行 他圖片會一直往下掉 但網頁一直往下捲動
我希望他碰到plane那張圖時 就會停止
請問我該如何修正
新手請大家多指教...
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 211.75.192.91
※ 文章網址: https://www.ptt.cc/bbs/Ajax/M.1434097695.A.1C4.html
推
06/13 19:42, , 1F
06/13 19:42, 1F
→
06/13 19:42, , 2F
06/13 19:42, 2F
→
06/13 19:43, , 3F
06/13 19:43, 3F
→
06/13 19:43, , 4F
06/13 19:43, 4F
→
06/13 19:44, , 5F
06/13 19:44, 5F
→
06/13 22:04, , 6F
06/13 22:04, 6F
推
06/13 22:29, , 7F
06/13 22:29, 7F
→
06/13 22:30, , 8F
06/13 22:30, 8F
→
06/13 22:30, , 9F
06/13 22:30, 9F
→
06/13 22:31, , 10F
06/13 22:31, 10F
→
06/13 22:31, , 11F
06/13 22:31, 11F
→
06/13 22:34, , 12F
06/13 22:34, 12F
→
06/13 23:21, , 13F
06/13 23:21, 13F
→
06/13 23:22, , 14F
06/13 23:22, 14F
→
06/13 23:22, , 15F
06/13 23:22, 15F
→
06/14 00:17, , 16F
06/14 00:17, 16F
→
06/14 11:17, , 17F
06/14 11:17, 17F
Ajax 近期熱門文章
PTT數位生活區 即時熱門文章
-10
17