Skip to content

Commit 0cc282d

Browse files
committed
Merge pull request #3 from jsfront/master
update
2 parents 971995c + 2c12503 commit 0cc282d

File tree

3 files changed

+203
-63
lines changed

3 files changed

+203
-63
lines changed

css.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ a{-webkit-tap-highlight-color:rgba(0,0,0,0);}
177177
- webkit 水平居中
178178
```css
179179
display:-webkit-box;-webkit-box-pack:center; -webkit-box-align: center;
180+
position:absolute; top:50%;left:50%;transform:translate(-50%,-50%);
180181
```
181182
- 取消chrome 搜索x提示
182183
```css
@@ -265,4 +266,23 @@ user-select:none;
265266
</div>
266267
```
267268

269+
- 手机多终端适配 media query[web app iphone4 iphone5 iphone6 响应式布局 适配代码](http://club.zoomla.cn/PItem?id=12594)
270+
```css
271+
@media (device-height:480px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone4/4s */
272+
.class{}
273+
}
274+
@media (device-height:568px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone5 */
275+
.class{}
276+
}
277+
@media (device-height:667px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone6 */
278+
.class{}
279+
}
280+
@media (device-height:736px) and (-webkit-min-device-pixel-ratio:2){/* 兼容iphone6 Plus */
281+
.class{}
282+
}
283+
```
268284

285+
- 屏蔽苹果浏览器对数字的识别[Meta标签中的format-detection属性及含义](http://blog.sina.com.cn/s/blog_51048da70101cgea.html)
286+
```html
287+
<meta content="telephone=no" name="format-detection">
288+
```

js.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Math.random()*(n-m)+m
77
```
88

99
- [return false](http://stackoverflow.com/questions/1357118/event-preventdefault-vs-return-false)
10+
- [return false](http://www.75team.com/archives/201)
1011
```javascript
1112
// event.preventDefault()会阻挡预设要发生的事件.
1213
// event.stopPropagation()会阻挡发生冒泡事件.
@@ -16,6 +17,13 @@ Math.random()*(n-m)+m
1617
// 停止callback function的执行并且立即return回来
1718
```
1819

20+
- 防止被Iframe嵌套
21+
```javascript
22+
if(top != self){
23+
location.href = ”about:blank”;
24+
}
25+
```
26+
1927
- 两种图片lazy加载的方式
2028
第一个By JS中级交流群 成都-猎巫 第二个By 上海-zenki
2129
```javascript

0 commit comments

Comments
 (0)