Here are the features of this Content Spoiler
- The button text changes accordingly. The "show more" will appear if it is in the hide state or the texts are hidden and "show less" will appear if it is in the show state mood.
- You can use this spoiler in multiple manner even in a single page.
- The spoiler will not work in Internet Explorer .
Putting a Show - Hide Effect or Content Spoiler in Blogger
Step 1. Log-in to your Blogger account
Step 2. Click the Template button ( have a back - up of your template)
Step 3. Hit the Edit HTML button
Step 4. Look for the code below
</head>Step 5. And just above that code </head> paste the following css code
<style type='text/css'>
/* animated spoiler CSS by Bloggingtipsandtrix.blogspot.com */
.spoilerbutton {
display:block;
margin:5px 0;
}
.spoiler {
overflow:hidden;
background: #f5f5f5;
}
.spoiler > div {
-webkit-transition: all 0.2s ease;
-moz-transition: margin 0.2s ease;
-o-transition: all 0.2s ease;
transition: margin 0.2s ease;
}
.spoilerbutton[value="Show - More"] + .spoiler > div {margin-top:-100%;}
.spoilerbutton[value="Show - Less"] + .spoiler {padding:5px;}
</style>
Step 6. Save your template!
Everytime you want to use the content spoiler, just paste the HTML (code) below in your blogger editor's page (be sure to switch your blogger editor page in HTML mode)
<input class="spoilerbutton" onclick="this.value=this.value=='Show - More'?'Show - Less':'Show - More';" type="button" value="Show - More" />
<div class="spoiler">
<div>
Your text here that you want to hide
</div>
</div>
Customization
- You can change the background color of the "Show - More/Show - Less" or the content spoiler button by replacing the hexadecimal color f5f5f5 with your own. You can use our color code generator.
- Replace the text Show - More with "Show" and Show - Less with "Hide" or any text that you want, both in css code (step 5) and in HTML (below step 6 code).
- You can adjust the speed of the texts that you hide in getting in and out by adjusting the texts in green (0.2s). The unit is in seconds (s), therefore if you will lower the number from 0.2 s to 0.1s the speed will increase and if you increase the number from 0.2s to 0.3s, 0.4s, 0.5s, 0.6s, 0.7s the speed of getting in and out will decrease.
God Bless Us All!
About the Author:
Hello folks! This is GOLDEN WORKS TV, the admin of this blog. No words could described my grateful appreciations to all newbie and professional bloggers around the world and most especially to Almighty God who gave me the wisdom...Read More
This comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteI have same problem as you. but I can resolve it by removing < br / >
ReplyDeleteadded by blogspot between these two line.
value="Show - More" />
< div class="spoiler">
and then click update without change the editor to compose mode.
I think I'll be disappointed in the answer since it appears it is common practice for feeds to strip "dangerous" onclick attributes but is there any chance this works in feed readers?
ReplyDeleteThe one I use now doesn't, it shows the hidden text instead. But to make matters worse it just stopped working in email subscriptions too. Button lights up but in this case, text remains hidden.
It will take alot of work for me to change methods but if yours works, atleast in email, I'll do so gladly.
(and don't you just hate how blogger adds html where ever it wants! I swear it takes longer for me to remove worthless code than it does to write the post.)
And thanks in advance :>)
You are absoulutely right bro!Thanks for your valuable comment!
ReplyDeleteHello, hope you're doing ok tonight. today!
ReplyDeleteI/ve sent you an email just a minute ago hope it answers your query Ma'am..
Thanks for visiting!!!
I'm well, thanks!
DeleteI'm going to try it out on my next post. It is definitely less code than my current one. However I apologize because I did not make myself clear. Toggle works beautifully on the blog page when viewed directly.
However, in feed readers and email subscriptions toggle does not work at all. In Feedreaders like Feedly, Live Bookmarks and default atom rss show the hidden content while email hides it, and you can't toggle to show.
Since, unfortunately, a majority of our loyal readers use those two methods to read our posts, hiding content becomes problematic.
From what I have read, "onclick" is likely the problem. It is considered to be a dangerous attribute so it is automatically stripped/removed.
The extra "br" I understand and know to remove before I publish. Thank you for reminding me.
I do have one question. Inside the "hidden" portion I am putting a CSS formatted blockquote. Is there any way to change the surrounding white box to another color?
Hello Ma'am, You can change the surrounding background white box by changing its border color..
DeleteHope it answer your question Ma'am...
Thank you kind Sir :>)
DeleteAt your service Ma'am! Stay connected and God Bless Your Families...
DeleteThis doesn't work the button it there and the spoiler text is under the button and the button does nothing
ReplyDeletehttp://thelmgnfiles.blogspot.com/
Hello, I just tried out your script and it wonderfully does what it's supposed to do. My only problem is – it's causing the post in the center column of my blog to spread to the full width of my monitor, causing the side navigation to be squeezed underneath. Any idea on what's causing this, and how to avoid it? My blog has a 3 column layout.
ReplyDeleteI have been using this method on my blog, but there is one problem which is that when I zoom my blog, the text, which is supposed to be hidden, shows up (but not all). It means the spoiler cannot carry the long text. Is there any ways to fix this?
ReplyDeleteI've tried to get that Spoilertag into my blog for ours now an the best reult I was able to get is this
ReplyDeletehttp://doesthisthingreallywork.blogspot.co.uk/
Please, can someone tell me, what the hell I'm doing wrong?
Not an expert but it seems to work on dynamic classic just fine. The other dynamic views, not so much. What I do know is that dynamic views are very hard to edit. Heck blogger completely broke my dynamic views months ago so now all I get is a blank page.
DeleteThanks. That's Perfectly worked for me.
ReplyDeletehttp://pricelistbd57.blogspot.com/
Is there any way to spoiler text in the comments section?
ReplyDeleteOr is that just impossible?