
內容簡介
這個外掛是我們 Adjustly 主題的內部開發項目,它可以讓作者將兩個 HTML 元素鏈接起來作為觸發器和目標。當單擊觸發器時,目標將立即展開以顯示其內容。
試用演示
如果您想看看 Adjustly Collapse 的默認安裝內容,可以在我們的網站上查看一些示例。
http://www.psdcovers.com/adjustly-collapse/
用法
沒有任何 CSS 圖案的基本結構如下:
<a class="aj-collapse" rel="myslidingcontent">觸發器</a>
<div class="aj-hidden" id="myslidingcontent">目標:此內容默認是隱藏的</div>
在上面的示例中,觸發器是 href 元素,目標是 div 元素。請注意,目標可以是您選擇的任何元素。
rel=”[id]”
每個觸發器和目標對必須包含一個共同的標籤,以便觸發器知道要展開或折疊哪個目標。觸發器的 rel 標籤必須與目標的 id 標籤相同。如果您計劃在頁面、文章或主題中使用多個可折疊元素,則需要確保每個觸發器/目標組合的 rel 和 id 標籤始終是唯一的。
類名
觸發器必須始終具有以下類名: class=”aj-collapse”
目標可以有以下兩個類之一: class=”aj-hidden” 將使目標默認折疊,而 class=”aj-visible” 則會正常顯示內容,但允許觀看者將其折疊。
注意事項
觸發器和目標不一定需要彼此相鄰。目標可以位於文章的對立面,或者可以將目標放在觸發器內部。主題開發人員可以使用它使插件可折疊。
外掛標籤
開發者團隊
原文外掛簡介
Developed internally for our Adjustly theme, this plugin allows authors to link 2 html elements together as trigger and target. When the trigger is clicked the target will immediately expand to reveal its content.
Try the Demo
If you’re interested in seeing what a default installation of Adjustly Collapse has to offer, have a look at some samples on our site.
http://www.psdcovers.com/adjustly-collapse/
Usage
The basic structure without any CSS bells and whistles looks like this:
trigger
In the example above, the trigger is an href element and the target is a div element. Note that the target can be any element you choose.
rel=”[id]”
Each trigger and target pair must contain a common label so that the trigger knows which target to expand or collapse. The trigger rel tag must be the same name as the target’s id tag. If you plan on having multiple collapsible elements in a page, post or theme then you will need to ensure that the rel and id tags are always unique for each trigger/target combo.
Class Names
The trigger must always have the following class name: class=”aj-collapse”
The target can have either of 2 classes: class=”aj-hidden” will make the target collapsed by default while class=”aj-visible” will display the content normally but allow the viewer to collapse it.
Notes
The trigger and target do not have to be next to each other. The target can be at the opposite end of the article or you can place it within the trigger. Theme developers can use it to make widgets collapsible.
