爱易网
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 浏览次数:22891 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
要完成此效果把如下代码加入到<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 全部选择 提示:你可先修改部分代码,再按运行]
上一篇:狡猾的按钮特效
下一篇:倒计时载入页面
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
FDD牌照12月将发放 联通电信双4G反击中移动
Line风靡亚洲,在北美却进展缓慢
国网公司将加快组建 业界人士称困难重重
微软不会被颠覆
微信将商场O2O战火烧到了阿里巴巴老家
联发科享用价钱战 专利难以摆脱高通
微软张亚勤趋势判断:未来三十年属于物理化互联网
Kindle入华遭遇国内厂商“围剿 ” 电信也参战
流浪汉高考状元终于找到工作:月薪3000做程序员很满意
推荐阅读
更多>
人们为什么总愿尝试新社交网络?
支付宝钱包支持医保移动缴费 广州成首个试点
网络视频的几大趋势将成视频玩家躲不开的发力点
微软小冰复活再战移动端:改与米聊、易信和触宝合作
安全服务机构:公布2014年度最糟糕的25个密码
支付宝被曝严重破绽 隐私平安再受质疑
中兴引进黑莓三个核心团队
苹果优势逐渐丧失 传即将推出廉价iPhone
论:三大运营商运用商店逆袭并非不能够
iPhone 6 Plus要召回是谣言
科技巨匠体验谷歌眼镜:戴上了就不想摘上去
苹果App Store被大量刷榜:iTunes账号成帮凶
历史惊人相似:如今的库克 曾经的鲍尔默
迅雷欲3300万美元收购金山快盘 预计9月完成
猎豹移动上市押海外市场 与小米有合作空间
中国手游总裁及8名高管集体下岗,被指涉不当交易
国美在线叫板京东:李俊涛底气在哪?
【晚报】女子泰国游晒10照片 流量费2000
三大运营商获通知大减营销费 传3年减400多亿
传运营商高层将变化 专家称需体制革新