[WordPress] 外掛分享: WP Fluid Images

首頁外掛目錄 › WP Fluid Images
WordPress 外掛 WP Fluid Images 的封面圖片
400+
安裝啟用
★★★★★
5/5 分(7 則評價)
5067 天前
最後更新
問題解決
WordPress 3.0+ v1.1.2 上架:2011-10-28

內容簡介

WP Fluid Images 在您於文章或頁面中插入圖像時執行。它會從圖像標籤中刪除固定的寬度和高度屬性。如果您使用圖像上傳工具插入圖像,預設情況下,會於圖像標籤中插入帶有固定像素值的寬度和高度屬性。此外掛可防止此類情況發生,因為如果您的佈景主題是使用回應式設計方法建構的,這樣做可能會造成問題。此外掛還會在文件最後附近添加一個樣式標籤,以設定最大寬度為100%的規則。這有助於確保文章或頁面中的任何圖像都不會延伸到超出文章或頁面的寬度。

如果您在視覺化編輯器中調整圖像大小,新的寬度和高度屬性將會被添加到圖像中。 WP Fluid Images 會載入一個 jQuery 腳本,該腳本會檢查最近的父 div 中的圖像標籤。它會計算圖像的寬度作為該 div 寬度的百分比,刪除寬度和高度屬性,然後添加一個帶有設置為計算百分比的寬度值的樣式屬性。

WordPress 畫廊中的圖像的寬度屬性將計算為其父級 .gallery-icon 元素的百分比。

如果您插入帶有標題的圖像,此外掛會將寬度作為百分比應用於 .wp-caption div,而不是圖像上應用樣式屬性。

外掛標籤

開發者團隊

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

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

原文外掛簡介

WP Fluid Images runs when you insert an image into a Post or Page. It removes the fixed width and height attributes from the image tag. If you insert an image from the image uploader, by default, a width and height attribute is inserted into the image tag with fixed pixel values. This plugin prevents this from happening, because this can be problematic if your theme is built using responsive design methods. The plugin also adds a style tag near the end of the document that sets a max-width rule of 100%. This helps ensure that any image in a Post or Page won’t extend past the width of the Post or Page.
If you resize an image in the Visual Editor, a new width and height attribute get added to the image. WP Fluid Images loads a jQuery script that examines the closest parent div for image tags. It calculate the image’s width as a percentage of the width of that div, removes the width and height attributes, and adds a style attribute with a width value set to the calculated percentage.
An image that is part of a WordPress gallery will have it’s width attribute calculated as a percentage of its parent .gallery-icon element.
If you insert an image with a caption, instead of applying a style attribute with a width as a percentage to the image, the plugin will apply it to the .wp-caption div.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon