Saturday, July 14, 2007

new expansions

I have replaced the not quite right "read more" links that could only be on the bottom of the post and couldn't be changed to anything else and didn't quite work right anyway. Now my blog is much

much much much
cooler than before.

Here's what I did:

Place into the stylesheet of the template:
.commenthidden {display:none}
.commentshown {display:inline}

Place into the head, not in the stylesheet:

<script type="text/Javascript">
function togglecomments (postid) {
var whichpost = document.getElementById(postid);
if (whichpost.className=="commentshown") {
whichpost.className="commenthidden"; }
else {
whichpost.className="commentshown"; }
}
</script>

And then this into the post template:

<a aiotitle="click to expand" href="javascript:togglecomments('UniqueName')">tease text</a>
<div class="commenthidden" id="UniqueName">hidden stuff goes here</div>

And, yes, "UniqueName" has to actually be a unique name. I little more complicated in the actual post but miles better.

(And this is where I stole it.)

Of course, it probably doesn't work in the RSS feed anyway.

No comments: