メニューを切り替える
Toggle preferences menu
個人設定を切り替える
ログインしていません
編集を行うと、IPアドレスが公開されます。

「テンプレート:Spoiler」の版間の差分

提供:Sleeping Cocoon-wiki
テンプレート>Rye Greenwood
Moved documentation to subtemplate.
 
編集の要約なし
 
(同じ利用者による、間の3版が非表示)
1行目: 1行目:
<includeonly><!--  
<includeonly><!--  


NOTE: This template needs javascrpit in mediawiki:common.js and/or mediawiki:mobile.js
Base code written for Terraria Wiki: https://terraria.wiki.gg/wiki/Template:Spoiler


--><span class="spoiler-content {{#if:{{{hover|}}}|hover}} {{{class|}}}" id="{{{id|}}}" style="{{{css|{{{style|}}}}}}"><span>{{{1|}}}</span></span><!--  
NOTE: This template needs a JavaScript function in MediaWiki:Common.js or MediaWiki:Vector.js to work, as well as styling in MediaWiki:Common.css or MediaWiki:Vector.css for the related classes
 
-->{{#vardefine:element|{{#if:{{{block|}}}|div|span}}}}<!--
 
--><{{#var:element}} class="spoiler-content {{{class|}}}" id="{{{id|}}}" style="{{{css|{{{style|}}}}}}"><{{#var:element}}>{{{1|}}}</{{#var:element}}></{{#var:element}}><!--
-->[[Category:Pages with spoilers]]<!--
--></includeonly><noinclude>
--></includeonly><noinclude>
{{doc}}
{{doc}}
{{category|Templates}}
[[Category:Formatting templates]]
{{language info|en=Template:Spoiler}}
</noinclude>
</noinclude>

2025年1月12日 (日) 03:06時点における最新版

ファイル:Template-info.svg Documentation The documentation below is transcluded from テンプレート:Spoiler/doc. (edit | history)

This template is used to mark text and other elements as spoilers. Users can click or optionally hover to reveal their content.

The hoverShowSpoilers gadget[編集]

Users can enable Gadget-hoverShowSpoilers to make spoilers show on hover, not just on click. The code for this gadget can be found at テンプレート:Gad.

Examples[編集]

Code Result
{{spoiler|spoiler text}} (Click to toggle) spoiler text
{{spoiler|spoiler text with a [[Template:Navbox|link]]}} (Click to toggle) spoiler text with a link
{{spoiler|block=y|Really long spoiler that spans multiple lines

It even has a bulleted list inside it:
* Item a
* Item b
* [[Special:Random|Item c]]
}}
Really long spoiler that spans multiple lines

It even has a bulleted list inside it:

Dependencies[編集]

For this template to work properly, you need the following:

Source[編集]

Base code adapted from Template:Spoiler on Terraria Wiki.

TemplateData[編集]

This template can be used to mark text as a spoiler.

テンプレートパラメーター[テンプレートデータを編集]

このテンプレートは、パラメーターを1行で記述することが推奨されています。

パラメーター説明状態
Text1 text

The text to be shown.

Character A died during the battle.
内容必須
Show on Hover?hover

Show spoiler text on mouse hover.

既定
hover=no
hover=yes
ブール値省略可能
Display as block?block

If given, display the spoiler as a block instead of inline. Useful for long spoilers spanning multiple lines or using block-level elements like lists.

y
ブール値推奨
Classclass

A class or classes to apply to the spoiler

文字列省略可能
IDid

A CSS ID to apply to the spoiler.

文字列省略可能
Stylestyle css

Inline CSS styles to pass in.

文字列省略可能