<script language=javascript>
function get_cookie(name_to_get) {
    var cookie_pair
    var cookie_name
    var cookie_value
    var cookie_array = document.cookie.split("; ")
    // Run through the cookies
    for (counter = 0; counter < cookie_array.length; counter++) {
        // Split the cookie into a name/value pair
        cookie_pair = cookie_array[counter].split("=")
        cookie_name = cookie_pair[0]
        cookie_value = cookie_pair[1]
        // Compare the name with the name we want
        if (cookie_name == name_to_get) {
            // If this is the one, return the value
            return unescape(cookie_value)
        }
    }
    // If the cookie doesn't exist, return null
    return null
}
// Get the bgColor cookie
var bg_color = get_cookie("bgColor_cookie")
// Did the cookie exist?
//if (bg_color) {
//    document.bgColor = bg_color
//}
function set_color(color_val) {
    // Get the currently selected color
    //var color_list = color_form.color_name
    //var selected_color = color_list.options[color_list.selectedIndex].value
    
    // Change the color of the background
    //opener.document["bgColor"] = color_val
    
    // Save it in a cookie
    set_cookie("bgColor_cookie", color_val, 365, "/")
}
function set_cookie(cookie_name, cookie_value, cookie_expire, cookie_path, cookie_domain, cookie_secure) {
    // Begin the cookie parameter string
    var cookie_string = cookie_name + "=" + cookie_value
    // Add the expiration date, if it was specified
    if (cookie_expire) {
        var expire_date = new Date()
        var ms_from_now = cookie_expire * 24 * 60 * 60 * 1000
        expire_date.setTime(expire_date.getTime() + ms_from_now)
        var expire_string = expire_date.toGMTString()
        cookie_string += "; expires=" + expire_string
    }
    // Add the path, if it was specified
    if (cookie_path) {
        cookie_string += "; path=" + cookie_path
    }
    // Add the domain, if it was specified
    if (cookie_domain) {
        cookie_string += "; domain=" + cookie_domain
    }
    // Add the secure Boolean, if it's true
    if (cookie_secure) {
        cookie_string += "; true"
    }
    // Set the cookie
    document.cookie = cookie_string
}
if (bg_color) {
    bb1.style.backgroundColor = bg_color
}
</script>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#a9a9a9,endColorStr=#ffffff)" ><form id="bb1">
<div align="left">
      <tr>
       <td width="281"><div align="left">
        <table border="1" width="240" cellspacing="0" cellpadding="1" height="12" id="table1" style="border-collapse: collapse" bordercolor="#000000">
       <tr>
<td onClick="bb1.style.backgroundColor='ffffff';set_color('ffffff')" bgcolor="#ffffff" width="50"></td>
            <td onClick="bb1.style.backgroundColor='E8FFF3';set_color('E8FFF3')" bgcolor="#E8FFF3" width="50"></td>
            <td onClick="bb1.style.backgroundColor='F1E8FF';set_color('F1E8FF')" bgcolor="#F1E8FF" width="50"></td>        
            <td onClick="bb1.style.backgroundColor='B4E7D9';set_color('B4E7D9')" bgcolor="#B4E7D9" width="50"></td>
            <td onClick="bb1.style.backgroundColor='CDCDDE';set_color('CDCDDE')" bgcolor="#CDCDDE" width="50"></td>
            <td onClick="bb1.style.backgroundColor='00bfff';set_color('00bfff')" bgcolor="#00bfff" width="50"></td>
            <td onClick="bb1.style.backgroundColor='6495ed';set_color('6495ed')" bgcolor="#6495ed" width="50"></td>
            <td onClick="bb1.style.backgroundColor='ffdab9';set_color('ffdab9')" bgcolor="#ffdab9" width="50"></td>
            <td onClick="bb1.style.backgroundColor='66cdaa';set_color('66cdaa')" bgcolor="#66cdaa" width="50"></td>
            <td onClick="bb1.style.backgroundColor='a9a9a9';set_color('a9a9a9')" bgcolor="#a9a9a9" width="50"></td>
        </tr>
         </table>
      </div></td>
   </tr>
</div>
.....我的网页文字内容
</font></form></body>提问如下:
<说明>通过以上生成的一定颜色的表格实现网页的背景色,但是颜色过于单一,我想实现点击单元格以使网页内出现渐进色。<问题>有没有办法在网页运行后,通过点击单元格来实现网页的渐进色吗?(某个颜色---->白色)<补充>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="FILTER: progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#a9a9a9,endColorStr=#ffffff)" >
以上代码在运行前添加可实现渐进色效果,但是能不能在运行时改变body的样式呢?请高手帮忙?