How to Expand and Collapse Texts or Post In Blogger

Taken from: http://soundatventure.blogspot.com/2013/01/how-to-expand-and-collapse-texts-or.html
Head over to your template and click on Edit HTML..
Search for these codes

.commenthidden {display:none}
.commentshown {display:inline}


Paste the following code underneath it.

.posthidden {display:none}
.postshown {display:inline}


*If it is not there, search for this code instead(remove spacing in-between)

]]>< /b:skin>


place these two code before it

.posthidden {display:none}
.postshown {display:inline
}


After doing that, search for the closing head tag

</head>

And paste the following script above the closing head tag

<script type="text/Javascript">
function expandcollapse (postid) {
whichpost = document.getElementById(postid);
if (whichpost.className=="postshown") { whichpost.className="posthidden"; } else { whichpost.className="postshown"; } }
</script>

You are done with the template.. Save your template.
Now each time you want to make your post expand or collapse under a certain subtopic, you just have to copy and paste these code in the HTML mode while you are composing your post.

<a href="javascript:expandcollapse('subtopicID')">
<h4>Click to Expand and Collapse</h4></a>
<span class="posthidden" id="subtopicID">
Now you see me now you dont</span>


You are suppose to change the highlighted code into your own words.. I am using the text in my example 1 refer to it if you are not sure of what to change.

As for the subtopicID, if you like you can use a string of numbers. Take note that both subtopicID must be the same in order to work.

0 Response to "How to Expand and Collapse Texts or Post In Blogger"