View Full Version : color coded comments


subdaisy
01-05-2005, 04:38 PM
I can't seem to find the post on who to alter the background color of comments, can someone help. I was also interested in putting a box around the comment left also. such as this http://www.xanga.com/item.aspx?user=xXxWickedGamexXx&tab=weblogs&uid=182366322

Is it possilbe to do both?

monkigurl77
01-05-2005, 10:51 PM
Just change the X's to the colors you would like:


<!-- begin code provided by createblog.com -->
<script language="javascript">
function colorComments(){
//Edit your first color below
var blogring="#XXXXXX";
//Edit your second color below
var dotnet="#XXXXXX";
var colorchange=0;
var comments = document.all ? "class"+"Name" : "class";
var backgrounds = document.getElementsByTagName("table");
for (var cn=0; cn < backgrounds.length; cn++){
if (backgrounds[cn].getAttribute(comments) == "blogbody"){
colorchange = colorchange == 1 ? 0 : 1;
backgrounds[cn].style.backgroundColor = colorchange == 1 ? blogring : dotnet;
}}}
if (document.location.href.indexOf("item.aspx") != -1) colorComments();
</script>
<!-- end code provided by createblog.com -->

Place it in your website stats and you'er good to go!