Pen Settings

HTML

CSS

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URLs added here will be added as <link>s in order, and before the CSS in the editor. You can use the CSS from another Pen by using its URL and the proper URL extension.

+ add another resource

JavaScript

Babel includes JSX processing.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

Auto Save

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <html>
<head lang="en">
    <meta charset="UTF-8">
    <title>Spoilers</title>
</head>
<body>

<div>
    <p><strong>The following story contains spoilers.</strong></p>
    <p>Did you see Corrie last night? Tina McIntyre&#39;s killer was finally revealed as she was pushed to her death. Click through to find out more!</p>
    <p><span class="spoiler" publishing-rule="spoiler">After months of speculation Rob Donovan was revealed as Tina McIntyre&#39;s killer in last night&#39;s (May 27) dramatic episode<em>&nbsp;</em>of <em>Coronation Street.</em></span></p>
    <p><span class="spoiler" publishing-rule="spoiler">The <em>Corrie</em> charmer, played by Marc Baylis,&nbsp;was responsible for Tina&#39;s fall from the balcony above Owen&#39;s builders&#39; yard, as a huge row between them accidentally ended in tragedy.</span></p>
    <p><span class="spoiler" publishing-rule="spoiler">Following months of speculation over the identity of Tina&#39;s murder, the episode saw Rob follow Tina to the top of the balcony where a violent tussle between the pair ended in her falling to the cobbles below.</span></p>
    <p><span class="spoiler" publishing-rule="spoiler">Although Rob didn&#39;t intend to hurt Tina, the accident will lead to her passing away in hospital next week.</span></p>
    <p><span class="spoiler" publishing-rule="spoiler">A huge row broke out between the pair as Tina threatened to reveal the truth about her affair with Rob&#39;s sister&#39;s husband, Peter Barlow.</span></p>
    <p><span class="spoiler" publishing-rule="spoiler">Rob wanted to spare Carla the heartbreak of finding out the truth about her cheating husband, but his intervention was in vain as Peter came clean to her about the affair before anyone else could.</span></p>
    <p><em>Coronation Street</em> bosses managed to prevent any leaks about the killer&#39;s identity until transmission last night, despite media attention around the storyline.</p>
    <p>On tonight&#39;s episode which airs at 9pm on UTV and TV3, viewers will see Tina rushed to hospital after the residents find her motionless body.</p>


</div>
</body>
              
            
!

CSS

              
                
              
            
!

JS

              
                (function ( $ ) {

    $.fn.spoiler = function( options ) {
        // Extendable options
        var settings = $.extend({
            // These are the defaults.
            text: "The following content contains spoilers, click to reveal",
            blur:4
        }, options );

        $(this).css({"color":settings.color,
                     "cursor":"pointer",
                     "filter":"blur("+settings.blur+"px)",
                     "-webkit-filter": "blur("+settings.blur+"px)",
                     "-moz-filter": "blur("+settings.blur+"px)",
                     "-o-filter":"blur("+settings.blur+"px)",
                     "-ms-filter": "blur("+settings.blur+")",
                     "filter":"progid:DXImageTransform.Microsoft.Blur(PixelRadius='"+settings.blur+"')",
                     "filter": "url(\"data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><filter id='blur'><feGaussianBlur stdDeviation='" + settings.blur + "' /></filter></svg>#blur\")"
                     }).on("click", function(){
            $(this).removeAttr('style');
        });

        //The returned
        return this;
    };

}( jQuery ));



$( document ).ready(function() {
  $( ".spoiler" ).spoiler({
    color:"#FF0000"
  });
});
              
            
!
999px

Console