2014年7月31日
摘要:
//scrollTop;var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop);// 屏幕可视区高度var viewHeight = document.compatMod === 'C...
阅读全文
posted @ 2014-07-31 14:19
坚壳
阅读(141)
推荐(0)
2014年7月30日
摘要:
function string10to64(number) { var chars = '0123456789abcdefghigklmnopqrstuvwxyzABCDEFGHIGKLMNOPQRSTUVWXYZ-~'.split(''), radix = chars.leng...
阅读全文
posted @ 2014-07-30 09:43
坚壳
阅读(2303)
推荐(0)
2014年7月24日
摘要:
(function test(x){ x=10; console.log(arguments[0], x); //undefined, 10})();(function test(x){ x=10; console.log(arguments[0]); // 10})(1)...
阅读全文
posted @ 2014-07-24 00:11
坚壳
阅读(290)
推荐(0)
2014年7月22日
摘要:
/** * 获取函数的形参个数 * @param {Function} func [要获取的函数] * @return {*} [形参的数组或undefind] */function getFuncParameters(func) { if (typeof func ...
阅读全文
posted @ 2014-07-22 15:22
坚壳
阅读(923)
推荐(0)
2014年7月9日
摘要:
/** * 定时器工厂 * @param {Number} interval [定时器间隔] * @param {Function} callback [定时执行的方法] * @param {Object} context [定时方法的作用域] * @param {Array} ...
阅读全文
posted @ 2014-07-09 17:00
坚壳
阅读(214)
推荐(0)
摘要:
function repeat(str, count) { return count '; }; document.write(s);}diamond('A', 5);
阅读全文
posted @ 2014-07-09 09:41
坚壳
阅读(835)
推荐(0)
2014年7月6日
摘要:
众所周知,盒子模型的宽度 = width + paddingLeft + paddingRight + boderLeftWidth + borderRightWidth;但如果元素存在滚动条,又将该如何计算呢? 看下demo: 从图中可以清楚的看到,滚动...
阅读全文
posted @ 2014-07-06 16:28
坚壳
阅读(717)
推荐(0)
2014年6月28日
posted @ 2014-06-28 02:35
坚壳
阅读(166)
推荐(0)
2014年6月3日
摘要:
原因一: 更加规范,利于解析原因二: 避免class等关键字引起的不兼容问题原因三: 可能也是最隐晦的:var a = 00; var b = {00: 12}; a in b; --> true var a = 0; var b = {'00': 12}; a in b; --> false ...
阅读全文
posted @ 2014-06-03 09:36
坚壳
阅读(244)
推荐(0)
2014年3月28日
摘要:
1 2 3 4 5 Document 6 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 297 298
阅读全文
posted @ 2014-03-28 14:00
坚壳
阅读(1349)
推荐(0)