前言介紹
- 這款 WordPress 外掛「Same Height」是 2015-10-14 上架。
- 目前有 100 個安裝啟用數。
- 上一次更新是 2017-01-24,距離現在已有 3022 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 1.3.0 以上版本才可以安裝。
- 有 4 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
外掛標籤
css | jquery | shortcode | javascript | sameheight |
內容簡介
有時我們想要將兩個框框並排顯示,並且它們必須看起來一模一樣。CSS並不總是有用的。
此外掛使用jQuery來偵測您想要的框框,並強制使它們具有相同的大小,它所使用的大小是最高框的大小。
如果您的內容的某些部分需要具有相同的高度,只需像這樣使用shortcode [sameheight/]:
[sameheight]
這是一段短文
[/sameheight]
[sameheight]
這是一段非常,非常,非常,非常,非常,非常長的文本
[/sameheight]
當HTML在您的屏幕上呈現時,兩個內容部分將具有相等的高度。這對於它們浮動在一起並且具有背景時非常有用。
如果我在同一頁面上有不同的大小呢?您可以像這樣分組shortcode:
[sameheight group="1"]
這是一段非常,非常,非常,非常,非常,非常,非常長的文本
[/sameheight]
[sameheight group="1"]
這是一段短文
[/sameheight]
[sameheight group="2"]
這是另一段短文
[/sameheight]
[sameheight group="2"]
這段文字很長,但不像上一段那樣長。因此,我不希望這些部分看起來那麼長。但它們還應該看起來一樣。
[/sameheight]
如果我有一個響應式網站,我只想在寬屏並排配置中應用相同的高度怎麼辦?您可以像這樣添加斷點。
[sameheight breakpoint="xs"](您甚至可以不使用斷點)
這是一段非常,非常,非常,非常,非常,非常,非常長的文本
[/sameheight]
[sameheight breakpoint="xs"](您甚至可以不使用斷點)
這段文字必須始終使用與上一個相同的高度。
[/sameheight]
[sameheight breakpoint="md"]
這是一段非常,非常,非常,非常,非常,非常長的文本
[/sameheight]
[sameheight breakpoint="md"]
這段文字只有在旁邊時才需要使用相同的高度,但在智能手機上則不需要使用相同的高度。
[/sameheight]
您有這些斷點(熟悉Bootstrap的人知道它們):
"xs"強制所有窗口寬度(超小窗口-智能手機)使用相同高度。或者,您可以不使用斷點
"sm"強制窗口寬度> 768px(小窗口-小平板電腦)使用相同高度
"md"強制窗口寬度> 992px(中窗口-平板電腦或小桌面電腦)使用相同高度
"lg"強制窗口寬度> 1200px(大窗口(大窗口-大型桌面電腦)使用相同高度。
原文外掛簡介
Sometimes we want to display to boxes side by side and they have to look the same. CSS doesn’t always help.
This plugin will use jQuery to detect the boxes you want and force them all to have the same size. The size is uses is the size of the tallest box.
If you have a some parts of your content that need to have the same height, simply wrap them with the [sameheight/] shortcode like this:
[sameheight]
This is a short text
[/sameheight]
[sameheight]
This is a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long text
[/sameheight]
When the html renders on your screen, both parts content parts will look equally height. This is very useful if they are floating next to each other and they have a background.
What if I have different sizes in the same page?
You can group shortcodes like this:
[sameheight group=”1″]
This is a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long text
[/sameheight]
[sameheight group=”1″]
This is a short text
[/sameheight]
[sameheight group=”2″]
This is another short text
[/sameheight]
[sameheight group=”2″]
This text is long, but not quite as long as the previous one. So, I don’t want these to parts to look as long. But they should still look the same.
[/sameheight]
What if I have a responsive site and I only want the same height to apply in wide-screen, side-by-side configurations?
You can add a breakpoint like this.
[sameheight breakpoint=”xs” ] (You could even use no breakpoint at all)
This is a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long text
[/sameheight]
[sameheight breakpoint=”xs” ] (You could even use no breakpoint at all)
This text always has to use the same height than the previous one.
[/sameheight]
[sameheight breakpoint=”md”]
This is a very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very, very long text
[/sameheight]
[sameheight breakpoint=”md”]
This text only has to use the same height when it is next to the previous, but not when it is underneath on smarphones.
[/sameheight]
You have these breakpoints (those familiar with bootstrap know them):
“xs” forces same height for all window widths (extra small window – smartphone). Alternatively, you can use no breakpoint
“sm” forces same height for window widths > 768px (small window – small tablet)
“md” forces same height for window widths > 992px (medium window – table or small desktop)
“lg” forces same height for window widths > 1200px (large window – desktop)
Names and widths are based on bootstrap.
Please, note that shortcodes with different “breakpoint” will be in different groups regardless of the “group” setting. You can still use “group” to separate to groups with the same “breakpoint”.
I have some styles in CSS for my classes. How can I apply classes to the content?
Easy:
[sameheight additional_classes=”my-class1 my-classA”]
This is a short text
[/sameheight additional_classes=”my-class2 my-classB”]
[sameheight]
This is a very, very, very, very, very, very long text
[/sameheight]
Can I use all the possibilities together?
Sure:
[sameheight group=”1″ breakpoint=”md” additional_classes=”my-class1 my-classA” /] will work.
Do I need to use the shortcode?
No! If you are editing your html, you can put the right properties in it. That’s all tha shortcode does. Make sure you add the class ‘same-height’. If you use a break point, add it with a hyphen (-) like this: ‘same-height-xs’, ‘same-height-sm’, ‘same-height-md’, or ‘same-height-lg’. The Javascript is looking for those classes to identify the html elements it has to work on.
If you are grouping boxes, use the ‘same-height-group’ property. Like
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Same Height」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
延伸相關外掛(你可能也想知道)
Enable jQuery Migrate Helper 》隨著 WordPress 5.5 的更新,一個名為 jquery-migrate 的遷移工具不再默認啟用。這可能會導致一些主題或外掛在運行舊代碼時缺少功能或出現意外行為。, 此外掛...。
WP Featherlight – A Simple jQuery Lightbox 》WP Featherlight 是一個 WordPress 外掛,可為您的WordPress 網站添加一個極簡、高效、響應式 jQuery 燈箱。在其核心,WP Featherlight是一個用於 Featherlig...。
jQuery Updater 》此外掛更新jQuery至最新的官方穩定版本,該版本通常不會在WordPress最新的穩定版本中提供。, jQuery Migrate也包含在內,以實現向下相容性。, 不會替換任何檔...。
Animate It! 》在你的內容中添加炫酷的CSS3動畫效果。, 演示 | 文件 | Class Generator, , 一些主要功能包括:, , 允許用戶在文章、小工具和頁面中應用CSS3動畫。, 50多種進...。
Scroll To Top 》這個外掛可以自動啟用一個客製化且靈活的「回到頂部」按鈕到您的 WordPress 網站,讓您的訪客只需點擊一下,即可將網頁滾動回頂端!, 功能包括:, , 無需設置...。
jQuery Colorbox 》查看最新的 WordPress 外掛優惠。, 一个用于 WordPress 的 Colorbox/Lightbox 外掛。, jQuery Colorbox 提供了 11 个不同的主题可供选择。请查看我的网站。, ...。
WordPress Countdown Widget 》這是一個 WordPress 倒數計時外掛,可輕鬆地將倒數/計時器添加到博客文章和側邊欄中。支援易於翻譯、自訂顏色和多個實例。只需拖曳即可,無需編程!, , 你可以...。
Use Google Libraries 》e's content distribution network (CDN) URLs for the supported libraries., This hook is used to replace the default WordPress registered script sour...。
Scroll Back To Top 》Scroll Back to Top 是一個 WordPress 外掛,它會在使用者向下滾動頁面時出現一個按鈕,允許使用者回到頁面頂部。外掛已經預先設定好,啟用後即可使用。該外...。
Meteor Slides 》Meteor Slides 讓您輕鬆製作幻燈片並使用 shortcode、小工具或模板標籤發佈它們。 幻燈片支援響應式和流體佈景主題,可適應任何設備並支援觸控。 使用超過20...。
jQuery Manager for WordPress 》管理 WordPress 網站上的 jQuery 和 jQuery Migrate,啟用特定版本的 jQuery 和/或 jQuery Migrate。這是 WordPress 上的終極 jQuery 調試工具。, , 總結:更...。
Dynamic "To Top" Plugin 》這個 WordPress 外掛可新增一個自動的動態「回到頂部」按鈕,方便使用者輕易捲回長頁面的頂部。, 外掛有一個直覺式控制面板,可以針對每個網站的需求進行風格...。
Version Control for jQuery 》jQuery 版本控制是控制網站上使用 jQuery 版本最簡單的方法之一。您可以選擇運行穩定的 WordPress 網站, 或是要在您的網站上驗證與各種 jQuery 版本的相容性...。
Pojo Lightbox 》請注意:此外掛僅供Pojo Framework使用者使用。, 一個簡單的外掛,方便地將PhotoSwipe lightbox和prettyPhoto lightbox功能添加到您的WordPress貼文和頁面。,...。
jQuery Lightbox For Native Galleries 》已停用通知: 為了推薦 Jetpack 外掛 中輪播模組的使用,此外掛已停止開發。我建議您改用該外掛 - 功能更全面。, 此外掛可以讓 WordPress 相片集使用一個名為C...。