爱易网
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 浏览次数:20482 次
欢迎光临爱易网网页脚本特效中心,点击运行按钮演示特效:
以下是程序代码
<STYLE>.drag { CURSOR: hand; POSITION: relative } </STYLE> <script> var sPosition; var showPerc=100; document.onmousedown=dragLayer document.onmouseup=new Function("dragMe=false") var Color= new Array(); Color[0] = "00"; Color[1] = "11"; Color[2] = "22"; Color[3] = "33"; Color[4] = "44"; Color[5] = "55"; Color[6] = "66"; Color[7] = "77"; Color[8] = "88"; Color[9] = "99"; Color[10] = "AA"; Color[11] = "BB"; Color[12] = "CC"; Color[13] = "DD"; Color[14] = "EE"; Color[15] = "FF"; var rVal,gVal,bVal, cCol function chgBg() { cCol = document.bgColor; rVal=cCol.substr(1,2); gVal=cCol.substr(3,2); bVal=cCol.substr(5,2); ind = Math.round(showPerc/16); if (ind < 0) ind = 0; if (ind > 15) ind=15; if (kObj.id =="knobImg") document.bgColor="#"+Color[ind]+gVal+bVal; if (kObj.id =="knobImg1") document.bgColor="#"+rVal+Color[ind]+bVal; if (kObj.id =="knobImg2") document.bgColor="#"+rVal+gVal+Color[ind]; } var dragMe=false, kObj, yPos,direction function moveLayer() { if (event.button==1 && dragMe) { oldY = kObj.style.pixelTop; kObj.style.pixelTop=temp2+event.clientY-yPos; if (kObj.style.pixelTop > oldY) direction="dn"; else direction="up"; if (kObj.style.pixelTop < 2 && direction=="up") {kObj.style.pixelTop=2; direction="dn";} if (kObj.style.pixelTop > 102 && direction=="dn") {kObj.style.pixelTop=102; direction="up";} sPosition=kObj.style.pixelTop; showPerc = (perCent[0].checked) ? sPosition-2 : (sPosition-2)/2*5; chgBg(); return false; } } function dragLayer() { if (!document.all) return; if (event.srcElement.className=="drag") {dragMe=true; kObj=event.srcElement; temp2=kObj.style.pixelTop; yPos=event.clientY; document.onmousemove=moveLayer; } } </SCRIPT> </div> <DIV id=outerLyr style="BACKGROUND-COLOR: #000000; HEIGHT: 120px; LEFT: 233px; POSITION: absolute; TOP: 111px; WIDTH: 23px; Z-INDEX: 1"><img class=drag id=knobImg src="test/ti.bmp" style="HEIGHT: 17px; LEFT: 2px; TOP: 100px; WIDTH: 20px; Z-INDEX: 3" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/> <DIV id=innerLyr style="BACKGROUND-COLOR: #777777; HEIGHT: 117px; LEFT: 2px; POSITION: absolute; TOP: 2px; WIDTH: 20px; Z-INDEX: 2"> <DIV id=barLyr style="BACKGROUND-COLOR: #000000; HEIGHT: 110px; LEFT: 9px; POSITION: absolute; TOP: 5px; WIDTH: 2px; Z-INDEX: 1"></DIV></DIV></DIV> <DIV id=outerLyr1 style="BACKGROUND-COLOR: #000000; HEIGHT: 120px; LEFT: 268px; POSITION: absolute; TOP: 111px; WIDTH: 23px; Z-INDEX: 1"><img class=drag id=knobImg1 src="test/ti.bmp" style="HEIGHT: 17px; LEFT: 2px; TOP: 100px; WIDTH: 20px; Z-INDEX: 3" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointer;"/> <DIV id=innerLyr1 style="BACKGROUND-COLOR: #777777; HEIGHT: 117px; LEFT: 2px; POSITION: absolute; TOP: 2px; WIDTH: 20px; Z-INDEX: 2"> <DIV id=barLyr1 style="BACKGROUND-COLOR: #000000; HEIGHT: 110px; LEFT: 9px; POSITION: absolute; TOP: 5px; WIDTH: 2px; Z-INDEX: 1"></DIV></DIV></DIV> <DIV id=outerLyr2 style="BACKGROUND-COLOR: #000000; HEIGHT: 120px; LEFT: 300px; POSITION: absolute; TOP: 111px; WIDTH: 23px; Z-INDEX: 1"><img class=drag id=knobImg2 src="test/ti.bmp" style="HEIGHT: 17px; LEFT: 2px; TOP: 100px; WIDTH: 20px; Z-INDEX: 3" onload="return imgzoom(this,600);" onclick="javascript:window.open(this.src);" style="cursor:pointe
上一篇:狡猾的按钮特效
下一篇:变色的表格框
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
电信资费新政:三巨头压力大 短期降价仍有争议
中国邮政与阿里合作:邮政网点可做网购自提点
继续涨:微博IPO第二交易日 收盘大涨11.71%
英特尔VS苹果:移动芯片大战
解析2014年阿里百度等五大互联网巨头深度布局
App Store严禁推送广告 运用面临大清洗
迅雷再次在美提交IPO申请
微软不会被颠覆
国美痛批网购七宗罪 用短暂盈利输了未来
推荐阅读
更多>
广电地方营业厅的一句“罚停”,暴露出了他们的本质
华为变阵:任正非调整三大业务布局
“扫黄打非”下9158否认遭整顿
支付宝曝平安破绽:转账信息被谷歌抓取
中国首台比特币ATM登陆上海 可购买不可兑换现钞
支付宝被曝严重破绽 隐私平安再受质疑
中国雅虎邮箱今日关停 由盛及衰的背后
苹果CEO抱歉解读:是战略而非“屈服”
史上最严电话实名制9月实行 三大难题待解
联通丹东公司一高管造假套出手机变卖被判刑7年
苹果音乐效劳新战略:与唱片商停止流媒体协作
佳能利润大跌三成 智能终端倒逼相机厂商转型
AMD Q1净亏1.46亿美元 转战SOC拥抱ARM求变
FDD牌照12月将发放 联通电信双4G反击中移动
互联网情色众多 Facebook与9158态度大不同
微软很“捉急”:补贴Win8 重加末尾按钮
打车软件“明补变暗补”背后的小算盘
清点:罗永浩推锤子ROM 小米打法遭模拟
全球五大电信设备商业绩:华为净利居首
电信资费新政:三巨头压力大 短期降价仍有争议