爱易网
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 浏览次数:20546 次
以下是程序代码
<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
上一篇:狡猾的按钮特效
下一篇:鼠标移动时,表格行和列背景同时变色的一则网页特效代码
免责声明:
本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
相关资料
更多>
QQ空间与微信龟兔赛跑,商业生态链陷入死循环
2018年阿里云双11活动如何参加?1折优惠大攻略
史玉柱谈创业:5大建议 失败的教训最真实
雷军收买腾讯金山股份:持股比例升至27%
谷歌新技术进入iOS平台:将叫板苹果Siri
团购网站存活率仅18.6% 剩余缺乏千家
快播灭了,还有西瓜:视频网站的灰色江湖还在
第二梯队也PK:当1号店“遇上”京东手机节
新一代iPhone11月底国内上市 支持TD制式
推荐阅读
更多>
代工厂生活危机:“富士康们”何去何从?
中移动落马高管盘点:广东移动成反腐重地
全球网络遭史上最大规模攻击:攻击数据每秒300G
Line风靡亚洲,在北美却进展缓慢
快递企业征收“份子钱” 成全了谁 苦了谁?
阿里巴巴IPO难掩的四个现实问题:天猫销售额成谜、淘宝拖后腿、营收迅猛其他不行和投资者未必买账
同为70前后人,马云为什么总是像外星人那么瘦
微信收费形式三选一 腾讯或变身运营商
中国大陆人口13.7亿 光棍越来越多
三星起诉LG在冰箱广告中玷污其企业笼统
华为任正非:家族成员不会成为接班人
搜房网遭遇做空 利益保送成“猎杀”焦点
用户喊话当当网:我彻底把你们丢弃了
玩游戏式的趣味戒烟App:Kwit
电信业营改增今起实施 运营商短期利润骤降
苹果App Store被大量刷榜:iTunes账号成帮凶
国内云服务商存在尴尬:“远程机房+移动大硬盘”模式
开个房刷个卡全世界都知道个人隐私成公开秘密
虚拟运营商流量不清零吸引用户 盈利待明
中兴引进黑莓三个核心团队