萬盛學電腦網

您现在的位置: 萬盛學電腦網 >> 程式設計 >  >> 網頁製作 >> Dreamweaver 教學

Dreamweaver 製作漂浮廣告:Persistent Layers 外掛實戰

前置準備

需下載安裝 flevPersistentDivs.mxp 擴充套件(Adobe Extension Manager 安裝)。安裝後位於「行為」→「新增行為」→「RibbersZeewolde」→「Persistent Layers」。

製作流程

  1. 「插入」→「版面物件」→「AP Div」(圖層),放入廣告圖片,設定 ID(如 floatAd)。
  2. 選取 <body> 標籤(或任意觸發元素),開啟「行為」面板,新增「Persistent Layers」行為。
  3. 設定參數:
  • Select Layer: 選擇 floatAd。
  • The Layer Should:
    • Stick to the top/left position defined by its CSS style:固定於 CSS 定義位置(實測為右上)。
    • Stick to the position specified by the following options:自訂位置。
  • Horizontal: Left / Right(水平靠左/右)。
  • Vertical: Top / Bottom(垂直靠上/下)。
  • Persistent:
    • Static:靜止固定(不隨捲軸移動)。
    • Animated:滑動跟隨,可調整速度(兩種模式略有差異,自行測試)。

實測心得

外掛介面為英文,建議多嘗試組合找到理想效果。Animated 模式下廣告會平滑跟隨捲軸,適合側邊固定廣告;Static 則像 position:fixed 固定視窗。

Persistent Layers 設定介面

現代替代方案

純 CSS 即可實現:position: fixed; top: 20px; right: 20px; z-index: 9999; 配合 transition 做滑動進場,無需外掛、效能更好、相容性完美。若需「滾動時跟隨、停留時固定」進階效果,可用 position: sticky 或 IntersectionObserver API。

copyright © 萬盛學電腦網 all rights reserved