爱易网
IT新闻
IT新闻
爱易资讯
网站搭建
云虚拟主机教程
云服务器教程
Apache教程
IIS教程
Nginx教程
网站策划
站长文章
推广教程
淘宝客教程
网页设计
HTML教程
XHTML教程
CSS教程
HTML5教程
CSS3教程
JavaSript基础
JQuery教程
Node.js教程
前端技术
Ajax教程
Js特效
Xml教程
平面设计
页面UI设计
photoshop教程
程序开发
AI人工智能
Asp教程
Php教程
Asp.Net教程
Net Core教程
C#教程
Java教程
Jsp教程
开发技术
微信小程序教程
Uniapp开发教程
微信公众号开发
Andriod教程
IOS教程
DOS教程
Python教程
Docker教程
Windows Container教程
数据库
MSSQL教程
MySQL教程
Redis教程
Access教程
Oracle教程
数据库教程
操作系统
Linux教程
Windows教程
MAC教程
Cisco教程
交换机教程
防火墙教程
搜索
爱易网页
JS特效
用鼠标选定背景颜色
用鼠标选定背景颜色
日期:2014-05-18 浏览次数:23064 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
要完成此效果把如下代码加入到<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> <a href="http://www.aiyiweb.com/js/">欢迎访问爱易网JS特效</a>
[Ctrl+A 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:倒计时载入页面
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
亚马逊Fire Phone:请别拿我跟苹果三星比
国美苏宁线上首度正面PK 京东列席4月电商战
搜狐前副总编何毅加盟乐视 任车联网公司CEO
百度透露无人驾驶战略 研发三维交通地图
陈天桥之鉴:产品创新被扼杀那些事
全球最具“颠覆性”特质的公司排行榜TOP25
雅安地震救灾前线的科技之手 微弱而暖和
戴尔新CEO名单曝光:惠普甲骨文高管在列
【晚报】女子泰国游晒10照片 流量费2000
推荐阅读
更多>
京东联席董事长赵国庆上市前夕离职
史玉柱卸任巨人网络CEO 继位人选引猜想
马斯克的特斯拉能否保持好势头
苹果大中华区业绩回暖 中移动贡献或低于预期
为啥苹果定要出廉价iPhone?都是安卓逼的
小米盗版有理激怒乐视:提500部盗播证据猛追打
央行暂停二维码支付及虚拟信用卡 支付宝微信不知情
历史惊人相似:如今的库克 曾经的鲍尔默
诺基亚因充电器问题暂停销售Lumia 2520平板电脑
谷歌董事长成花花公子:情史足以媲美涂鸦
小微型IDC云化趋势加剧 云计算未来或现终极模式
苹果音乐效劳新战略:与唱片商停止流媒体协作
从旗下三大业务BG发展看华为的过去现在和未来
探析APP移动营销发扬实效的微妙
蘑菇街CEO陈琪:2015将回归社会化电商
英特尔VS苹果:移动芯片大战
顺丰O2O便利店将正式启动:涉及金融服务
评论:阿里为什么不试着收购一家香港媒体呢
聚美优品获基石投资1.5亿美金,IPO吃下定心丸
易信工具性优势突出 丁磊三板斧或先砍在飞信上