SpoilerAlert

: Important note: On 22 September 2017, this script was significantly updated. Its previous form violated customization policy. Please update your use of this script accordingly.
SpoilerAlert hides a specified area of a page, covering it with a dialog that asks the visitor if they want to risk seeing spoilers or not. If not, the area will remain hidden. If the visitor accepts, the foreground fades away and reveals the area. Additionally local storage is used, to ensure the visitor won't see this dialog for this particular page again.
== ==
== ==
To mark the spoiler area on your page, wrap that area in <div id="SpoilerAlert"></div> inside the source editor.
Important note: If more than 50% of the page's height is inside the <div> tag above, the spoiler warning will not be displayed. This was done to bring customization policy violations to a minimum.
== ==
You can configure the script to your liking by adding the following to MediaWiki:Common.js on your wiki and then modifying the values:
* If you want to change the text displayed on the spoiler dialog to be changed, change the question property. For example, like:
* If you want to change the text displayed on Yes/No buttons, change the yes or no property. For example, like:
* If the fade out effect after clicking the Yes button seems to be too long or short to you, you can change 1600 in the above configuration to a number of milliseconds you want the dialog to be fading out. For example:
 fadeDelay: 500
=== ===
This is an example configuration you can use for SpoilerAlert. It will:
* Set the question asked on spoiler areas to "Stop right there! This area contains some spoilers. Do you want to see them?"
* Set the Yes/No button texts to "Sure"/"Nah"
* Set the fade out delay to 0.5 seconds.