搭建中,开放编辑,欢迎收藏防止迷路。请参考:编辑帮助

全站通知:

模板:ToggleStart

来自土豆兄弟(Brotato)WIKI_BWIKI_哔哩哔哩
跳到导航 跳到搜索


Starts a toggleable section, with a button that collapses/uncollapses the wrapped text.

Must be used with ToggleEnd, which ends the toggleable section.

The ID should be unique, because the button will toggle any/all other toggleable sections with the same ID. Alternatively, if this effect is desired, the same ID can be used across multiple toggles.

Examples

Start Closed

This is the default behaviour, with the target section initially closed.

Code Preview
{{ToggleStart|id=foo|btn=Toggle Section}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
{{ToggleEnd}}
Toggle Section

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Start Open

Uses the option open=1.

Code Preview
{{ToggleStart|id=bar|btn=Toggle Section|open=1}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
{{ToggleEnd}}
Toggle Section

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Multiple Sections

You can toggle multiple sections with a single button, by using ToggleSection for each extra section.

Code Preview
{{ToggleStart|id=multidemo|btn=Toggle Section}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
{{ToggleEnd}}

{{ToggleSection|id=multidemo}}
Quisque aliquet ipsum nec magna mattis tincidunt.
{{ToggleEnd}}
Toggle Multiple Sections

Lorem ipsum dolor sit amet, consectetur adipiscing elit.

模板:ToggleSection Quisque aliquet ipsum nec magna mattis tincidunt.

Separate Button

You can insert the toggle button on its own with ToggleButton. This can be used with ToggleSection for instances where your toggleable section doesn't immediately follow the button.

Code Preview
{{ToggleButton|id=separatebtn|btn=Toggle Separate Section}}

{{ToggleSection|id=separatebtn}}
Lorem ipsum dolor sit amet, consectetur adipiscing elit.
{{ToggleEnd}}
模板:ToggleButton

模板:ToggleSection Lorem ipsum dolor sit amet, consectetur adipiscing elit.

无描述。

模板参数

参数描述类型状态
Button Textbtn

Text for the toggle button

默认值
Toggle
示例
Toggle More Details
字符串必填
IDid

Unique identifier for the toggle

字符串必填