爱易网
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特效
原生js编写的安全色拾色器,支持浏览器边缘碰撞翻转
原生js编写的安全色拾色器,支持浏览器边缘碰撞翻转
日期:2014-05-18 浏览次数:20574 次
以下是程序代码
<html > <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <style type="text/css"> #abc-colorPicker .colorPick-close,#filter-colorPicker .colorPick-close{position:absolute;right:0;} #abc-colorPicker a,#filter-colorPicker a,#colorPicker a{border-bottom:1px solid #000;border-left:1px solid #FFF;border-right:1px solid #000;border-top:1px solid #FFF;cursor:pointer;display:block;float:left;height:15px;overflow:hidden;width:15px;} #abc-colorPicker a:hover,#filter-colorPicker a:hover,#colorPicker a:hover{opacity:.5;} #abc-colorPicker li,#filter-colorPicker li,#colorPicker li{display:inline;list-style:none;overflow:hidden;} #abc-colorPicker ul,#filter-colorPicker ul,#colorPicker ul{-moz-transition:all .8s ease-in 1s;-ms-transition:all .8s ease-in 1s;-o-transition:all .8s ease-in 1s;-webkit-transition:all .8s ease-in 1s;float:left;margin:0;overflow:hidden;transition:all .8s ease-in 1s;width:102px;} #abc-colorPicker,#filter-colorPicker,#colorPicker{background:#FFF;border:solid 1px #eee;display:none;padding:5px;width:312px;} #demo{height:600px;margin:0 auto;width:800px;} *{margin:0;padding:0;} .colorPicker-container a:hover{border-bottom:1px solid #000;border-top:1px solid #000;} .colorPicker-preview{color:#FFF;display:inline-block;height:30px;line-height:30px;width:60px;} .colorPicker-title{height:30px;overflow:hidden;} </style> </head> <body> <div style="height:500px;"></div> <div id="demo"> <input type="text" id="filter"/> <input type="text" id="abc"/> </div> <script type="text/javascript"> /* * Copyright 2012 enix@foxmail.com */ function ColorPicker(k,j){var i=this,h=arguments.callee,l,b,c;if(!(this instanceof h))return i=new h(k,j);b=h.prototype;b.constructor=h;h.cache||(h.cache=[]);c={createColorData:function(){var a=h.cache,e,d,g,f=0,b,c=0;for(e=0;6>e;e++){a.push("<ul>");for(d=0;6>d;d++){a.push("<li>");for(g=0;6>g;g++)b=("000"+f.toString(16)).slice(-3).toUpperCase(),c++,i.color.push(b),a.push('<a index="'+c+'" style="background: #'+b+'" title="#'+b+'" javascript="void (0);"></a>'),f+=3;f+=30;a.push("</li>")}a.push("</ul>"); f+=480}"function"===typeof this.ongetcolorstring&&this.ongetcolorstring.call(this.color)},getHtmlElement:function(a){this.element||(this.element={});this.element[a]||(this.element[a]=l.createElement(a));return this.element[a].cloneNode(!0)},each:function(a,e){var d,b=0,f=a.length>>>0;if("Object"==={}.toString.call(a).slice(8,-1))for(d in a){if(!1===e.call(a[d],d,a[d]))break}else for(;b<f&&!1!==e.call(a,b,a[b++]););},getViewportSize:function(){var a=[0,0];void 0!==window.innerWidth?a=[window.innerWidth, window.innerHeight]:a=[document.documentElement.clientWidth,document.documentElement.clientHeight];return a},getClinetRect:function(a){a=a.getBoundingClientRect();return a=a={left:a.left,right:a.right,top:a.top,bottom:a.bottom,height:a.height||a.bottom-a.top,width:a.width||a.right-a.left}},getScrollPosition:function(){var a=[0,0];window.pageYOffset?a=[window.pageXOffset,window.pageYOffset]:"undefined"!=typeof document.documentElement.scrollTop&&0<document.documentEle
上一篇:狡猾的按钮特效
下一篇:鼠标移动时,表格行和列背景同时变色的一则网页特效代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
微软与摩托罗拉授权协议涵盖Android和Chrome设备
中移动推动感地带3G网聊卡 火拼微信沃卡
从雷军的“互联网七字诀”告诉你一个非妖魔化的小米
阿里物流搭上邮政:京东,我们在终点等你!
阿里国际化再落子:2.49亿美元投资新加坡邮政
马云的SNS之梦有了新目标 收购“微博”
传4G牌照国庆节前后发放 TD-LTE制式优先
打车软件竞争白热化:有冷兵器时代意味
估值增长9.8% 阿里IPO前市值达2450亿美元
推荐阅读
更多>
运营商补贴减少 国内通信业拐点逼近
看病也能用支付宝了 马云的又一盘大棋
十亿美元的告别礼:三星为何要大举重组?
搜房网遭遇做空 利益保送成“猎杀”焦点
微软最后的救命稻草Win 8份额继续上升
世界杯让耐克阿迪大打出手 谁能劈开用户大脑?
诺基亚培育低端机市场 迂回战术要挟中华酷联
IT企业人才争夺战打响:员工待遇水涨船高
国美痛批网购七宗罪 用短暂盈利输了未来
中国首台比特币ATM登陆上海 可购买不可兑换现钞
为啥苹果定要出廉价iPhone?都是安卓逼的
雷军收买腾讯金山股份:持股比例升至27%
盘点改变社会的15种科技:谷歌眼镜将使我们成为半机械人
挂号网高管团体离任 或因投资人失掉决计
马斯克的特斯拉能否保持好势头
独立工具APP:为亿级用户的商业化而愁
联想国庆完成收购IBM x86服务器
支付宝全面封杀比特币:充值码淘宝店或遭封禁
二代 iPad Air将配备2GB内存?为同屏多任务做准备
窗口期:还有哪些互联网公司可能今年IPO?