FrontPage 的跑馬燈元件僅支援單行文字,且功能受限;Dreamweaver 雖無專用視覺元件,但透過手寫 <marquee> 標籤配合屬性,反而能實現更豐富的多行、雙向、互動式滾動效果。建議直接在原始碼視圖或記事本中編輯。
<marquee scrollAmount="2" width="300">跑馬燈文字</marquee>
| 屬性 | 說明 | 建議值 |
|---|---|---|
| scrollAmount | 移動速度(像素/幀),值越大越快 | 1~3 |
| width / height | 滾動區域寬高,垂直滾動必須設定 height | 依版面而定 |
| direction | 滾動方向:left(預設)、right、up、down | 視需求 |
| scrollDelay | 幀延遲(毫秒),值越大越慢,通常不需設定 | 預設 90 |
| behavior | 滾動模式:scroll(循環)、alternate(來回)、slide(滑入停止) | 視效果 |
<marquee scrollAmount="2" width="300"><a href="https://www.cctv.com">中央電視台</a></marquee>
<marquee scrollAmount="2" width="300" onmouseover="this.stop()" onmouseout="this.start()">文字內容</marquee>
<marquee scrollAmount="2" width="99" behavior="alternate">文字內容</marquee>
<marquee scrollAmount="2" width="300" height="160" direction="up">
·早晨好啊!<br>
·空氣好清新啊<br>
·今朝食乜好呢?<p>
·<a href="https://www.cctv.com">中央電視台</a>
</marquee>
若頁面曾用 FrontPage 編輯儲存,<marquee> 內部標籤順序可能被打亂,導致只能滾動第一行。解決方法是將完整標籤包裹在 document.write() 中輸出:
<script>
document.write('<marquee scrollAmount="2" width="300" height="160" direction="up">...</marquee>');
</script>
這樣即可保持原始結構,發揮 HTML 靈活組合的威力。