ballhogjoni Posted January 22, 2008 Share Posted January 22, 2008 I want to change the column background in the table below. I can't figure out how to do this. Right now the script change the entire background of the page. Can someone help? <html> <head> <script type="text/javascript"> var c = new Array("#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#d6e7f8"); <!--"66", "77", "88", "99", "AA", "BB", "CC", "DD", x = 0; function bg_eff() { col_val = c[x]; document.bgColor=col_val; x++; if (x == 123) { document.bgColor="#d6e7f8"; clearInterval(change_bg); } } change_bg = setInterval("bg_eff()", 250); </script> </head> <body> <table> <tr> <td> </td> </tr> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
phpQuestioner Posted January 22, 2008 Share Posted January 22, 2008 <html> <head> <script type="text/javascript"> var c = new Array("#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#FFFFAA", "#FFFF99", "#FFFF88", "#FFFF77", "#FFFF66", "#FFFF55", "#FFFF44", "#FFFF33", "#FFFF22", "#FFFF11", "#FFFF00", "#FFFF11", "#FFFF22", "#FFFF33", "#FFFF44", "#FFFF55", "#FFFF66", "#FFFF77", "#FFFF88", "#FFFF99", "#FFFFAA", "#FFFFBB", "#d6e7f8"); <!--"66", "77", "88", "99", "AA", "BB", "CC", "DD", x = 0; function bg_eff() { col_val = c[x]; document.getElementById("colorize").style.background = col_val; x++; if (x == 123) { document.getElementById("colorize").style.background="#d6e7f8"; clearInterval(change_bg); } } change_bg = setInterval("bg_eff()", 250); </script> </head> <body> <table width=500 height=350 border=1> <tr id="colorize"> <td> </td> </tr> </table> </body> </html> Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted January 22, 2008 Author Share Posted January 22, 2008 Thanks you, that works for that example, but when I put it into my site it messes up the whole page. Meaning the table are all skewed and stuff. Any Ideas? Quote Link to comment Share on other sites More sharing options...
rhodesa Posted January 22, 2008 Share Posted January 22, 2008 Try getting rid of the following line: <!--"66", "77", "88", "99", "AA", "BB", "CC", "DD", Quote Link to comment Share on other sites More sharing options...
ballhogjoni Posted January 22, 2008 Author Share Posted January 22, 2008 That worked, Thaks for your help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.