学习笔记(三)

集锦:
1. clip:rect() 必须要和 absolute 合用,且 (1,2,3,4) 2&3 必须有(作为宽高)
2. scaleX 等的默认值是 0 不是 1,所以动画时会有一闪的状态
3. 移动端有时 touchstart 和 touchmove 基本并发,避免事件混淆可加偏移量大于5的判断
4. text-transform 有时会在跳页时回归最初(什么特定情况还未总结出)
5. 苹果机图片加载会阻塞后续程序
6. 苹果机在有覆盖层的情况下仍然可滚动下层内容,需 body 添加 overflow:hidden
7. 最好不要 for 里面套 ajax,不然你的服务器会超级兴(beng)奋(kui)的

新知识点:
1. console 的其他方法,console.time 和 console.timeEnd 测性能很赞(测 CSS 性能尚在寻求中)
2. Array.sort() 直接字符排序,数字排序可用 Array.sort(function(a,b){return a-b})
3. setTimeout(arguments.callee, 130); 130ms为周期重复调用本方法(但传参会消失,可以用 xx.call(this, arguments);)
4. contentWindow | contentDocument||document (获取 iframe 的 window 和 document)| jquery 有 $.fn.contents() 方法
5. object-fit: fill|contain|cover|none|scale-down (填满父级,IE不支持) object-position
6. 可以 (new Date).getDate();但其实速度更慢一点
7. querySelector() / $().get(0) / $()[0] 三者相比,后者更快
8. str.charCodeAt()(ascii转数字) | String.fromCharCode(num)(数字转ascii)65=A / 97=a
9. if 和 for 等终止于 ";" 那用 "," 就可以加多条语句了咯
10.<link rel="prefetch" href="http://www.xxx.com/" />(预读取,也可为js,css,图片等)
<link rel="prerender" href="http://www.xxx.com/" />(预渲染)

楷模:
http://www.jq22.com/demo/htm5SvgCheckbox20160911/
http://www.zhangxinxu.com/wordpress/2016/09/talking-about-css-infinite-endless-loop/
http://www.cnblogs.com/pssp/p/5906676.html
https://github.com/xiaoyu2er/blog/issues/1
https://github.com/xiaoyu2er/blog/issues/3
http://mp.weixin.qq.com/s?__biz=MzI0NTE4NjA0OQ==&mid=2658352417&idx=1&sn=cd6cfd54a9c341c415787c505acfcb09

原文地址:https://www.cnblogs.com/foreverZ/p/5937796.html