[WordPress] 外掛分享: Really Simple Popup

首頁外掛目錄 › Really Simple Popup
400+
安裝啟用
★★★★
4.6/5 分(10 則評價)
4123 天前
最後更新
問題解決
WordPress 3.5.1+ v1.0.11 上架:2013-03-31

內容簡介

一個簡單易用、採用fancybox風格的彈出視窗外掛。

此外掛可作用於你網頁內所有帶有Anchor Tag的圖片。若在同一頁面有多張圖片,此外掛會自動建立一個小型圖庫,讓你可透過按鈕或鍵盤上下頁瀏覽。進階使用者也可以輕鬆地在彈出視窗內開啟Iframe和HTML內容。

進階使用者
基本使用

要在圖片上啟用彈出視窗,請在該圖片的Anchor Tag中加入class:“hs-rsp-popup”。

進階使用

若要停用圖庫功能或令某張圖片不啟用彈出視窗,只需在其Anchor Tag上加上class: no-hsrsp-popup
要在彈出視窗中開啟Iframe內容,請將Iframe的src設定為href,並在Anchor Tag內部加上class:“iframe hs-rsp-popup”
要在彈出視窗中顯示HTML內容,請使用兩個Anchor Tag。首先,在href中加入欲顯示內容的元素ID,接著使用class:“hiddendiv hs-rsp-popup”。

範例

要彈出某張圖片,請在該圖片的Anchor Tag內加上class:“hs-rsp-popup”
例如: <a href="image.png" class="hs-rsp-popup"><img src="image.png" alt="image"/></a>

若要使用Iframe,請設定Iframe的src,然後在Anchor Tag內部加上class “iframe”,再結合 class “hs-rsp-popup” 使用:
觀看這個

你還可以使用此方法顯示HTML內容。若欲顯示本地內容,只需在href中輸入該元素的ID:
點擊這裡
Hello, World!

若欲顯示遠端內容,只需在href中輸入網頁的連結,例如:
點擊這裡

設定彈出視窗大小(圖片/Iframe)

你可以在連結中使用以下HTML5 Data Attribute 設定視窗大小: data-popupheight="100" data-popupwidth="300",這些值的單位為像素。

例如:

注意:為了使此功能生效,你必須使用data-popupwidth和data-popupheight這兩個屬性。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0.11) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Really Simple Popup」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Simple, easy to use, fancybox style popup.
Works for all images in your page that are in anchor tags. If it finds more than one, it will create a small gallery you can navigate through with the buttons or your keyboard. Advanced users can open iframes and html content in it fairly easily.
Avanced users
Basic use
Anchor class for popup: “hs-rsp-popup”
Advanced use

disable gallery feature and popup for image by adding this class: no-hsrsp-popup
anchor classes for iframe popup “hs-rsp-popup iframe”
anchor classes for html popup “hs-rsp-popup hiddendiv”

Examples
To popup an image give the anchor tag around the image this class: “hs-rsp-popup”
Example: image
For an iframe, set the srct of the iframe and use the class “iframe” combined with “hs-rsp-popup”:
Watch this
You can also use this to show html content. For local content just use the id of the element for the href:
click here
Hello, World!
For remote content, link to the page, for example:
click here
Setting Popup Size (image/iframe)
You can use the following html5 data attributes in your link to set the size: data-popupheight="100" data-popupwidth="300" These values are in pixels.
For Example:

Note: for this to work, you have to use both the data-popupwidth and data-popupheight attributes.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon