·用户注册
·用户登陆
·用户中心
首页
+
网络学院
+
网页特效
+
实用工具
+
网络资源
+
字体下载
+
娱乐世界
+
时尚前沿
+
图片中心
+
动漫天地
+
金石社区
图形
-
网页设计
-
优化
-
动易
-
动网
-
HTML
-
PSD
-
FLASH模板
-
插件
-
杀毒
-
系统工具
-
FLASH音乐
-
FLASH游戏
-
美女
您现在的位置:
金石网
>>
网页特效
>>
页面背景
>> 特效正文
鼠标指向颜色块,在状态栏就能看到该颜色的代码
『 更新时间:2006-4-1 』『 字体:
变小
变大
』『 作者:未知 | 来源:网络 』
把如下代码加入<body>区域中: 要完成此效果把如下代码加入到<body>区域中 <script language="JavaScript"> <!-- var hex = new Array(6) hex[0] = "FF" hex[1] = "CC" hex[2] = "99" hex[3] = "66" hex[4] = "33" hex[5] = "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('</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[i], 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[i], 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[i] blue hex drawTable(hex[i]) // close current table cell document.write('</TD>') } // close table row and table document.write('</TR></TABLE>') } // call function to begin execution drawCube() // --> </script>
【点击数:】【
发表评论
】【
加入收藏
】【
告诉好友
】【
打印此文
】【
关闭窗口
】
相
关文章
您的姓名:
评分等级:
1分
2分
3分
4分
5分
评论内容:
1、严禁发表危害国家安全、政治、黄色淫秽等内容的评论。
2、用户需对自己在使用金石网服务过程中的行为承担法律责任。
3、本站管理员有权保留或删除评论内容。
4、评论内容只代表网友个人观点,与本网站立场无关。
自动显示访问者IP地址代码
3721拦截不了的弹窗代码
强制设置为主页
主页被强制修改
贪吃蛇游戏
俄罗斯方块
看谁围的圈多
射击游戏:A就是大炮
十字定全局
爱情游戏测试
网
友评论
|
设为首页
|
加入收藏
|
联系我们
|
版权申明
|
友情链接
|
站点地图
|
网站帮助
|
网站留言
|
广告服务
|
Copyright © 2001-2008
K
ings
N
et.biz All Rights Reserved. 金石工作室 版权所有