Html 及JS 程式碼如下: 複製程式碼 程式碼如下: 程式碼如下: style="位置:絕對;寬度:100px;"> 腳本之家 var newsOne = document.getElementById("newsOne"); newsOne.style.bottom = 0; newsOne.style.left = window.screen.availWidth - 100; var 底部= 0; function newsScroll() { if (bot>if (bottom > (window.screen.availHeight - window.screenTop)) { bottom = 0; newsOne.style.bottom = 0; } else { bottom = 底部15; >newsOne.style.bottom = 底部; } } var timeid = setInterval(newsScroll, 300); 函數CleartTimeInterVal() { clearInterval(timeid); } } 函數resetInterVal() { timeid = setInterval(newsScroll, 300); } 腳本> 線上執行: 線上運行: 線上運作: 腳本之家 var newsOne = document.getElementById("newsOne"); newsOne.style.bottom = 0; newsOne.style.left = window.screen.availWidth - 100; var bottom = 0; function newsScroll() { if (bottom > (window.screen.availHeight - window.screenTop)) { bottom = 0; newsOne.style.bottom = 0; } else { bottom = bottom + 15; newsOne.style.bottom = bottom; } } var timeid = setInterval(newsScroll, 300); function CleartTimeInterVal() { clearInterval(timeid); } function resetInterVal() { timeid = setInterval(newsScroll, 300); } [Ctrl A 全選注:如需引入外部 Js 需刷新才能執行]