
內容簡介
總結:Collapse Magic是一個能夠在頁面上方便顯示(可收合)展開更多文字的外掛程式,可以作為其他外掛程式(如collapse-o-matic)的替代選擇,且無需修改頁面內容即可直接替換使用。
問題與答案:
<ul>
<li>這個外掛程式具有哪些功能?</li>
<ul>
<li>易於實施</li>
<li>可配置擴展和收起標題</li>
<li>可配置上下箭頭</li>
<li>可調整收合狀態下可見文字的高度</li>
<li>可調整收合狀態下的淡出文字</li>
</ul>
<li>為什麼開發了Collapse Magic這個外掛程式?</li>
<ul>
<li>Collapse Magic為了在頁面上方便顯示(可收合)展開更多文字。</li>
<li>在發現collapse-o-matic存在跨站腳本漏洞時,開發了這個外掛程式。</li>
<li>它可以直接替代collapse-o-matic,無需對頁面進行任何更改即可使用。</li>
</ul>
<li>如何設置這個外掛程式?</li>
<ul>
<li>安裝外掛程式</li>
<li>從管理員設置選單中設置任何參數</li>
<li>在[magic_expand]...[/magic_expand]標籤或[expand]...[/expand]標籤之間放置文字,以使切換效果生效</li>
<li>如果需要,將替代的“展開更多”文字包含在短碼中,形式為[magic_expand title=”新展開更多文字”]</li>
<li>如果需要,將替代的“收合”文字包含在短碼中,形式為[magic_expand swaptitle=”新收合文字”]</li>
<li>單擊禁用按鈕以關閉短碼並顯示完整文字</li>
</ul>
<li>這個外掛程式的開發靈感是來自於誰?</li>
<ul>
<li>這個外掛程式受到Nelson Miller的方法的啟發:如何在Divi中展開和收合文字:jQuery代碼經過修改後用於這個外掛程式。</li>
</ul>
</ul>
外掛標籤
開發者團隊
原文外掛簡介
Collapse Magic provides an easy way to display (collapsible) read-more text on a page. This plugin is an alternative to other plugins like collapse-o-matic and can be used as a direct replacement without the need for any changes to page content.
Features
Easy to implement
Configurable expand and collapse labels
Configurable up and down arrows
Adjustable visible text height in the collapsed state
Adjustable fade-out text visible in the collapsed state
Unfortunately this plugin does not support Accelerated Mobile Pages (AMP)
Background
Collapse Magic provides an easy way to display (collapsible) read-more text on a page. Also, display a few lines of text and add read-more or expand text.
This plugin was developed when a cross-site scripting vulnerability was identified in collapse-o-matic. This plugin can be used as a direct replacement to collapse-o-matic. There is no need for any on-page changes to be made for the plugin to be used as a replacement.
Set-up
Install the plugin
Set any parameters from the admin Settings menu.
Place text between [magic_expand][/magic_expand] tags or between [expand][/expand] for the toggle to work.
Include alternate ‘read-more’ text if this is required in the shortcode as [magic_expand title=”NEW READ-MORE TEXT”].
Use alternate ‘read-less’ text if this is required in the shortcode as [magic_expand swaptitle=”NEW READ-LESS TEXT”].
Toggle button to set the default location of the expand / collapse label to above or below the section.
Single click disable button to switch off the shortcodes and show the full text.
Shortcode Parameters
Read-more / expand label – ‘title’. Example [magic_expand title=”–more–“].
Read-less / collapse label – ‘swaptitle’. Example [magic_expand title=”–more–” swaptitle=”–less–“].
Position of the expand label – ‘pos’. Example [magic_expand pos=”above”] or [magic_expand pos=”below”]
Credits
This plugin was inspired by the approach used by:
– Nelson Miller: How To Expand And Collapse Text In Divi: the jQuery code was modified for this plugin.
