
內容簡介
這是一個非常簡單的短碼系列,可創建一個文本區域,該文本區域可以基於標題上的單擊來隱藏或顯示。默認情況下,文本區域是隱藏的。
此短碼系列使用 jQuery 功能來 a) 確定要切換哪些文本區域和 b) 切換它們。
使用
基本用法是使用“[tt]”短碼將一段文本包圍起來,並在短碼中指定一個標題參數。標題將顯示在頁面上,前面帶有一個指示器,顯示相關文本區域是隱藏 (►) 還是顯示 (▼)。單擊標題鏈接將切換相關文本區域的顯示,並切換指示器。
通過“[tt_part]”和“[tt_all]”短碼,可以一次顯示或隱藏文本區域的組。
“[tt_part]”短碼使用名爲“class”的必填參數,將其與所有具有相同類參數的“[tt]”短碼及其相關聯的文本區域關聯。單擊“[tt_part]”標題鏈接將根據父短碼的狀態切換所有相關文本區域和任何具有相同類的“[tt_part]”短碼鏈接。當單擊父鏈接時已經顯示的該部分的文本區域將保持顯示,隱藏的文本區域也是如此。
“[tt_all]”短碼將切換所有“[tt]”短碼文本區域,任何中間“[tt_part]”鏈接以及任何鏡像“[tt_all]”鏈接,並根據特定標題鏈接的狀態切換。當單擊鏈接以顯示所有文本區域時,已經顯示的文本區域將保持顯示,隱藏的區域亦是如此。
“[tt_part]”和“[tt_all]”短碼都可以放置在網頁的任何位置,並且可以多次在同一網頁上使用。
參數
“[tt]”短碼具有一個必填參數和兩個可選參數,以及必填的短碼內容。
“class”參數是可選的:這將該特定文本區域與“[tt_part]”短碼關聯起來,從而可以顯示或隱藏文本區域組。該參數必須只包含字母和數字。
“style”參數是可選的:這允許作者將 CSS 樣式組件應用於給定的短碼內容,該內容僅在顯示該內容時可見。樣式組件僅限於適用於周圍區域和包括將顯示的區域的任何內容,並且僅限於以下內容:background-color、border、border-color、border-radius、border-size、border-style 和 color。任何其他樣式組件或其他內容將被忽略。
“title”參數是必需的:它是文本區域的標題,並用作控制鏈接。
“[tt_part]”短碼具有兩個必填參數;它不使用任何內容。
“class”參數是必需的:這是所有相關“[tt]”文本區域的鏈接。該參數必須只包含字母和數字。
“title”參數是必需的:這是控制鏈接的標題,在其前面加上“Show / Hide All”。
“[tt_all]”短碼沒有參數,也不使用任何內容。
外掛標籤
開發者團隊
原文外掛簡介
A very simple shortcode series to create a text area which can be hidden or displayed based on a click on the title. Text areas by default are hidden.
This shortcode series uses jQuery functionality to a) determine which text areas are to be toggled and b) toggle them.
Use
Basic use is to surround a block of text with the “[tt]” shortcode and specify a title parameter within the shortcode. The title will be shown on the page, preceeded by an indicator whether the associated text area is hidden (►) or shown (▼). Clicking the title link will toggle the display of the dependant text area, as well as toggle the indicator.
Groups of text areas can be shown or hidden at once through the “[tt_part]” and “[tt_all]” shortcodes.
The “[tt_part]” shortcode uses a required parameter named “class” that links it to all “[tt]” shortcodes and their associated text areas with the same class parameter. Clicking the “[tt_part]” title link will toggle all associated text areas and any “[tt_part]” shortcode links with the same class according to the status of the parent shortcode. Text areas of this section that are already displayed when the parent link is clicked will remain displayed, and vice versa with hidden text areas.
The “[tt_all]” shortcode will toggle all “[tt]” shortcode text areas, any intermediate “[tt_part]” links and any mirrored “[tt_all]” links, according to the status of the particular title link. Text areas that are already displayed when the overall link is clicked to display all the text areas will remain displayed, and vice versa with hidden text areas.
Both the “[tt_part]” and “[tt_all]” shortcodes may be placed anywhere on the web page and can be used multiple times on the same web page.
Parameters
The “[tt]” shortcode has one required parameter and two optional parameters, plus the required content of the shortcode.
The “class” parameter is optional: this links the particular text area with the “[tt_part]” shortcode, which can display or hide groups of text areas. This parameter must consist of only letters and numbers.
The “style” parameter is optional: this allows the author to apply CSS style components to the given shortcode content, which will only be visible when the content is made visible. Style components are limited to anything that applies to the area surrounding and including the area to be displayed and are limited to the following: background-color, border, border-color, border-radius, border-size, border-style, and color. Any other style components or any other text will be ignored.
The “title” parameter is required: this what is displayed as the title of the text area and is used as the control link.
The “[tt_part]” short code has two required parameters; it does not use any content.
The “class” parameter is required: this is the link to all associated “[tt]” text areas. This parameter must consist of only letters and numbers.
The “title” parameter is required: this what is displayed as the title of the control link, preceded by “Show / Hide All”.
The “[tt_all]” short code has no parameters and it does not use any content.
