跳转到内容

模板:Calculator-hideifzero/doc

来自天灾之下:危险连接资料站

Usage

Allows showing or hiding page elements based on Calculator formula. This requires the Calculator gadget to work.

Example

{{calculator-hideifzero|formula=showtext|Some text that might be hidden if the checkbox is unchecked}}

{{calculator|type=checkbox|id=showtext|default=1}} {{calculator label|Show text|for=showtext}} 

Creates:

Some text that might be hidden if the checkbox is unchecked

1 Show text

Template data

Allow showing or hiding a page element based on a calculator formula

模板参数

参数描述类型状态
formulaformula

Calculator formula to decide whether or not to show

字符串必需
texttext 1

Wikitext to show or hide

内容必需
blockblock

Whether to be a block (div) element or an inline (span) element

布尔可选
elementelement

Name of element to use (overrides block). For example, if you want to hide a list item, you would set this to li

默认值
span
示例值
li
字符串可选
classclass

Additional css classes

字符串可选
starthiddenstarthidden

Have the text start off being not shown

布尔可选
stylestyle

Additional CSS to add

字符串可选
class-liveclass-live

Additional css classes to add only once gadget is active

字符串可选