摘要: 1、.position()和.offset() jquery的.position()获取相对于最近的position为relative或absolute的父元素的偏移,返回.position().left和.position().top,不算上自己的margin-left; jquery的.offs 阅读全文
posted @ 2017-08-29 16:41 莫笑我胡为 阅读(432) 评论(0) 推荐(0) 编辑
摘要: 去重 去重方法和思路也很多,这里就介绍两种吧。 方法一: 1 2 3 4 5 6 7 8 9 10 11 function unique1(arr) { var res = [], len = arr.length; for (var i = 0; i < len; i++) { if (res.i 阅读全文
posted @ 2017-08-29 16:22 莫笑我胡为 阅读(621) 评论(0) 推荐(0) 编辑
摘要: 一、常用META 1. 添加到主屏后的标题(IOS) 1 <meta name="apple-mobile-web-app-title" content="标题"> 1 <meta name="apple-mobile-web-app-title" content="标题"> 1 <meta nam 阅读全文
posted @ 2017-08-29 15:56 莫笑我胡为 阅读(440) 评论(0) 推荐(0) 编辑
摘要: 之前在iphone上做开发时遇到一个问题,在一般的正常浏览器上输入以下代码: 1 2 var apple = document.getElementById('abc'); apple.focus(); 1 2 var apple = document.getElementById('abc'); 阅读全文
posted @ 2017-08-29 15:18 莫笑我胡为 阅读(11012) 评论(0) 推荐(0) 编辑