View Full Version : functions.php - comments question
Hi there,
I wondered if there was an easy way to hack the comments section in functions.php so I can have an alternating color (1 grey, 1 white comment) for example.
Any ideas?
Thanks
Karl
kevincrafts
12-12-2007, 01:16 AM
Instead of hacking the files you can put some javascript on the page. For instance, if you wrap your comments with a <div id="comments"> tag then you can do something like:
var comments = document.getElementById("comments");
var listItems = table.getElementsByTagName("li");
for(i = 0; i < listItems.length; i++){
if(i % 2 == 0){
listItems[i].className = "even";
}else{
listItems[i].className = "odd";
}
}
Hi Kevein,
Great idea! I will try it out later this morning.
Thanks
Karl
vBulletin® v3.7.3, Copyright ©2000-2013, Jelsoft Enterprises Ltd.