fingh 发表于 2007-4-27 11:29:50

***页面背景***背景调色板

把下列代码加到网页的<body></body>标签之间 从google下载我的照片管理软件
脚本说明:
把如下代码加入<body>区域中
<script language="javascript">
<!--

// copyright (c) 1996-1997 tomer shiran. all rights reserved.
// permission given to use the script provided that this notice remains as is.
// additional scripts can be found at http://www.geocities.com/~yehuda/

// create 6-element array
var hex = new array(6)

// assign non-dithered descriptors
hex = "ff"
hex = "cc"
hex = "99"
hex = "66"
hex = "33"
hex = "00"

// accept triplet string and display as background color
function display(triplet) {
    // set color as background color
    document.bgcolor = '#' + triplet

    // display the color hexadecimal triplet
    alert('现在的背景色是 #'+triplet)
}

// draw a single table cell based on all descriptors
function drawcell(red, green, blue) {
    // open cell with specified hexadecimal triplet background color
    document.write('<td bgcolor="#' + red + green + blue + '">')

    // open a hypertext link with javascript: scheme to call display function
    document.write('<a href="javascript:display(\'' + (red + green + blue) + '\')">')

    // print transparent image (use any height and width)

    document.write('<img src="place.gif" border=0 height=12 width=12>')

    // close link tag
    document.write('http://code.ik8.com/html/place.gif</a>')

    // close table cell
    document.write('</td>')
}

// draw table row based on red and blue descriptors
function drawrow(red, blue) {
    // open table row
    document.write('<tr>')

    // loop through all non-dithered color descripters as green hex
    for (var i = 0; i < 6; ++i) {
      drawcell(red, hex, blue)
    }

    // close current table row
    document.write('</tr>')
}

// draw table for one of six color cube panels
function drawtable(blue) {
    // open table (one of six cube panels)
    document.write('<table cellpadding=0 cellspacing=0 border=0>')

    // loop through all non-dithered color descripters as red hex
    for (var i = 0; i < 6; ++i) {
      drawrow(hex, blue)
    }

    // close current table
    document.write('</table>')   
}

// draw all cube panels inside table cells
function drawcube() {
    // open table
    document.write('<table cellpadding=5 cellspacing=0 border=1><tr>')

    // loop through all non-dithered color descripters as blue hex
    for (var i = 0; i < 6; ++i) {
      // open table cell with white background color
      document.write('<td bgcolor="#ffffff">')

      // call function to create cube panel with hex blue hex
      drawtable(hex)

      // close current table cell
      document.write('</td>')
    }

    // close table row and table
    document.write('</tr></table>')
}

// call function to begin execution
drawcube()

// -->
</script>




      










------ -------- - -   ----------------------

拥有三人行论坛管理系 列软件,一个人就可以管理一个论坛的更新维护。还能使您的论坛有 千人在线的真实火暴效果,让您不在为 论坛因没有人气而留不住会员而烦恼,使您的论坛早日成 为一流 的论坛 。详情请登陆网站:http://w ww.cnsrx.cn 三人行论坛管理软件,站长必备的专业好工具。(您 使用的 是免费版本,购买收费版本后,将不带广告。业务QQ:247216 449852 27)
页: [1]
查看完整版本: ***页面背景***背景调色板