2013年4月12日
摘要: 最近博客园不是很稳定博客迁移到github新地址:johnqing 阅读全文
posted @ 2013-04-12 23:07 刘卿 阅读(253) 评论(1) 推荐(1) 编辑
2013年3月11日
摘要: 今天看到群里聊到了逗号运算符,就总结一下,我对它的理解吧,勿喷!(ps:苦逼孩子,人家都讨论完半天了,刚才看到!!尼玛!)逗号运算符:是按顺序执行表达式,并且获得右边表达式的值。来个例子:var a = 10;var b = 20;var c = (a++,b++,100);console.log(a);console.log(b);console.log(c);值是11,21,100大彻大悟了么?关于运算符优先级问题可以查看:https://developer.mozilla.org/zh-CN/docs/JavaScript/Reference/Operators/Operator_Pre 阅读全文
posted @ 2013-03-11 23:18 刘卿 阅读(2655) 评论(2) 推荐(0) 编辑
2013年2月18日
摘要: 我常用到的2中转整数的方法:1、'0.12323' | 02、parseInt('0.00001')这些都很简单,这里要说的是1方法在前面字符串超过2147483647时就会出现错误2方法里的值必须是字符串不然在处理0.00001这类的数值时会返回最后一位 阅读全文
posted @ 2013-02-18 16:07 刘卿 阅读(1144) 评论(0) 推荐(0) 编辑
2013年2月17日
摘要: 英文:http://www.adequatelygood.com/2010/3/JavaScript-Module-Pattern-In-Depth模块模式是JavaScript一种常用的编码模式。这是一般的理解,但也有一些高级应用没有得到很多关注。在本文中,我将回顾基础知识,浏览一些不错的高级技巧,甚至我认为是原生基础的。基础知识首先我们开始简单概述模型模式。三年前Eric Miraglia(YUI)的博文使模型模式众所周知。如果你已经很熟悉模型模式,可以直接阅读“高级模式”。匿名闭包这是一切成为可能的基础,也是JavaScript最好的特性。我们将简单的创建匿名函数,并立即执行。所有函数内 阅读全文
posted @ 2013-02-17 10:49 刘卿 阅读(10702) 评论(0) 推荐(2) 编辑
2013年2月16日
摘要: 检测当前浏览器是否缩放https://github.com/Johnqing/browserZoom 阅读全文
posted @ 2013-02-16 16:44 刘卿 阅读(1926) 评论(0) 推荐(1) 编辑
2013年1月31日
摘要: cursor:url(http://localhost/d2/matches.cur),url(http://localhost/d2/matches.cur),n-resize; 1.IE6也支持cursor属性的URL值,然而,IE只支持CUR和ANI的格式。2.IE不支持CSS3的坐标。这时候光标图片将被忽略。3.Firefox1.5 (Gecko1.8), Windows and Linux和Safari3.0 (Webkit522-523)支持.cur | .png | .gif | .jpg和xy坐标值。4.Firefox4.0 (Gecko2.0)支持.cur | .png |. 阅读全文
posted @ 2013-01-31 16:53 刘卿 阅读(3038) 评论(0) 推荐(0) 编辑
2013年1月24日
摘要: 1.安装nodejshttp://nodejs.org/2.安装各自的node packagejs我用的是UglifyJS github地址:https://github.com/mishoo/UglifyJScss我用的是clean-cssgithub地址:https://github.com/GoalSmashers/clean-css图片用的是node-smushit github地址:https://github.com/colorhook/node-smushit3.编写代码//jsvar fs = require('fs');var jsp = require(&q 阅读全文
posted @ 2013-01-24 13:58 刘卿 阅读(15432) 评论(3) 推荐(0) 编辑
2013年1月22日
摘要: // 彩条function ColorBar(obj,timer){ this.target = obj; this.i = 0; this.wind = 0; this.timer = timer || 100; this.other = 0; this.init();}ColorBar.prototype = { init:function(){ this.createElem(); this.snowRun(); }, getRndAndFillZero :function (){ var str=Math.ceil(Math.random()*16777215).toStr... 阅读全文
posted @ 2013-01-22 15:00 刘卿 阅读(401) 评论(0) 推荐(0) 编辑
2013年1月20日
摘要: <style type="text/css">body{margin:0px;padding:0px;}.top{width:100%;height:25px;background:#eeeeee;border-bottom:1px solid #dcdcdc;}.box{height:300px;position:absolute;top:20px;width:200px;z-index:10000;-moz-transform:rotate(-3deg);-moz-transform-origin: 50% 0; -webkit-transform:rota 阅读全文
posted @ 2013-01-20 16:08 刘卿 阅读(847) 评论(1) 推荐(0) 编辑
摘要: // 扩展过渡效果到 jQuery jQuery.extend(jQuery.easing,{ def : "easeOutQuad", swing : function(c, a, b, d, e) { return jQuery.easing[jQuery.easing.def](c, a, b, d, e) }, easeOutBounce: function(c, a, b, d, e) { return (a /= e) < 1 / 2.75 ? d * 7.5625 * a *... 阅读全文
posted @ 2013-01-20 13:12 刘卿 阅读(1364) 评论(0) 推荐(0) 编辑