Advertisement
Guest User

Untitled

a guest
Apr 21st, 2015
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var randombgcolors=["green:white:yellow", "#DDF4FF", "#FFFF97", "#CFFF9F"]
  2.  
  3. var rbcssrule=""
  4. var randomnum=Math.floor(Math.random()*randombgcolors.length)
  5. if (randombgcolors[randomnum].indexOf(":")!=-1){
  6. rbcssrule="background-color: "+randombgcolors[randomnum].split(":")[0]+";"
  7. rbcssrule+="color: "+randombgcolors[randomnum].split(":")[1]+";"
  8. }
  9. else
  10. rbcssrule="background-color: "+randombgcolors[randomnum]+";"
  11.  
  12. document.write('<style type="text/css">\n')
  13. document.write('.randomcolor{'+rbcssrule+'}\n')
  14. if (randombgcolors[randomnum].split(":").length==3) //if link color specified
  15. document.write('.randomcolor a{color:'+randombgcolors[randomnum].split(":")[2]+';}\n')
  16. document.write('<\/style>')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement