Image Spoiler With Simple Animation For Blogger

blogger widget

we often use Spoiler effect or show hide effect in our Blogger template. This is useful for hiding multiple image and which can be visible by clicking on an spoiler button. The main effectively of this widget is to loading the Blog post fast. Because if you Blog post contain 5/10 images then it will take longer time to load, so image spoiler is the solution to control loading speed. So in this tutorial I will show you image Spoiler effect or show hide effect where you will able to hide multiple images and visitors can view by click on Spoiler button. Just follow the below steps-
LIVE DEMO

Step 1 Log in to your Blogger Account and Go to your Blogger Dashboard

Step 2 Click on  Now click on -> Template -> Edit HTML->

Step 3
 Now find the ]]></b:skin> by pressing Ctrl+F (Windows) or CMD+F (Mac)  

Step 4 Copy the script from below and Paste it above/before ]]></b:skin>
#image-spoiler {text-align:center;}
#image-spoiler button{margin:10px auto;cursor:pointer;background-color:#5a6269;color:#fff;padding:10px 14px!important;text-transform:uppercase;border:none;font-size:14px;transition:all .3s ease-out}
#image-spoiler button:hover, #image-spoiler button:focus {outline:none;opacity:1;color:#fff;}
#spoilerpanel {padding:1px;text-align:left;background:#fafafa;border:1px solid #e6e6e6;}
#spoilerpanel {padding:24px;display:none;}
#spoilerpanel img {background:#f5f5f5;margin:10px auto;}
.spoilerrow {-webkit-column-count:3;-moz-column-count:3;column-count:3;}
.spoilerrow img{-webkit-backface-visibility:hidden;margin-bottom:15px;max-width:100%;}
.spoilerrow br {display:none;}

Step 5 Now again find the </head> by pressing Ctrl+F (Windows) or CMD+F (Mac)  

Step 6 Copy the script from below and Paste it above/before </head> 

<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' type='text/javascript'></script>

<script type='text/javascript'>
//Image Spoiler widget by www.bloggerspice.com
$(document).ready(function(){$("#image-spoiler").click(function(){$("#spoilerpanel").slideToggle("normal")})});
</script>

CUSTOMIZATION

  • If you template already contain latest Jquery then you don't have to add the below jquery file.
<script src='https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js' type='text/javascript'></script>
Step 7 hit the Save template button.

HOW TO MAKE IT WORK?

For using this Custom button you have to add the code in HTML view while writing a Blog post. Just write a post and from Post Editor Select HTML mode. Now add the below code-

<div id="image-spoiler"><button>Spoiler with Image</button></div><div id="spoilerpanel"><br />
<div class="separator" style="clear: both; text-align: center;"><a href="IMAGE URL HERE" style="margin-left: 1em; margin-right: 1em;"><img src=" IMAGE URL HERE " style="border: none;" /></a></div>
</div></div>

CUSTOMIZATION

  • To add Images on Spoiler just replace IMAGE URL HERE with your image link
  • For adding multiple image just add the whole code twice. Just like below-
<div id="image-spoiler"><button>Image Spoiler</button></div><div id="spoilerpanel"><br />
<div class="separator" style="clear: both; text-align: center;"><a href="IMAGE URL HERE" style="margin-left: 1em; margin-right: 1em;"><img src=" IMAGE URL HERE " style="border: none;" /></a></div>

<div class="separator" style="clear: both; text-align: center;"><a href="IMAGE URL HERE" style="margin-left: 1em; margin-right: 1em;"><img src="IMAGE URL HERE " style="border: none;" /></a></div>
</div></div>



show and hide image

After adding the spoiler image then publish your post and check it a Image Spoiler button will be visible and click on it to view the images. 
Share:

1 comment:

  1. In this is just a very simple short WordPress tutorial videos tutorial on how to wrap text around a video I've also got a video on this blog post how to read wrap text around an image or a picture very very simple to to wrap text around and imaging WordPress of I've made up a video not put that on this blog post as well that the blog post is actually about how to wrap text around a video so if you don't want to just put the video up the top here you want to put it to the size to the left of the right it's very good very easy but what you need to do is you need to add a bit of code so I've written that code and I've put it in pink here on my site on this on this actual blog post only
    To know more click here

    ReplyDelete

Popular Posts

Powered by Blogger.

Translate

Labels

Blog Archive

Recent Posts

Unordered List

  • Lorem ipsum dolor sit amet, consectetuer adipiscing elit.
  • Aliquam tincidunt mauris eu risus.
  • Vestibulum auctor dapibus neque.

Pages

Theme Support

Need our help to upload or customize this blogger template? Contact me with details about the theme customization you need.