Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Add Reply
I cannot get this code to work; Color Code for User Names
Topic Started: May 23 2008, 02:07 PM (472 Views)
MotherHen
Member
 *  
I am trying to use the random color code for member names.
Quote:
 
<script>
/* Random Color Names, All membs version
By Godkillah from phantom-designs.net
cannot be redistributed/edited/rehosted */
var colors=["red","blue","green","yellow","orange","cyan"]
a=document.getElementsByTagName("a")
for(i=0;i<=a.length;i++){
if(a){
if(a.href.match(/showuser=/i)){
randomcol=colors[Math.floor(Math.random()*colors.length)]
a.style.color=randomcol
}}}
</script>

I put it at the top of the footer area, but nothing happens. My board Url is:
http://z11.invisionfree.com/Cottage_Keepers/
Can someone tell me how to fix this Please... :)
Offline Profile Quote Post Goto Top
 
Roby
Member Avatar
#27

Should work now. It was messed up because of the use of i's in the quote tag. It took it as italicized font and not to be plain text.
Code:
 
<script>
/* Random Color Names, All membs version
By Godkillah from phantom-designs.net
cannot be redistributed/edited/rehosted */
var colors=["red","blue","green","yellow","orange","cyan"]
a=document.getElementsByTagName("a")
for(i=0;i<=a.length;i++){
if(a){
if(a[i].href.match(/showuser=/i)){
randomcol=colors[Math.floor(Math.random()*colors.length)]
a[i].style.color=randomcol
}}}
</script>
Offline Profile Quote Post Goto Top
 
MotherHen
Member
 *  
Thank you so much...It works great now. :)
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · zIFBoards - Skinning & Code Support · Next Topic »
Add Reply