Skip to content

Instantly share code, notes, and snippets.

View CarterLi's full-sized avatar
😀

Carter Li CarterLi

😀
  • PRC
  • 17:59 (UTC +08:00)
View GitHub Profile
<!doctype html>
<meta charset="utf-8" />
<style type="text/css">
canvas {
display: block;
}
</style>
<input id="file" type="file" accept="image/*" multiple />
<canvas id="canvas"></canvas>
<script>

异步 与 Generator

讨论会上谈到了这两者的关系,自认为有些许心得,却羞于开口,于是有了这篇博文。

引题

……

@CarterLi
CarterLi / everything.html
Last active April 1, 2016 08:10
很牛B的html代码,丢进去没错的
<!-- 适应移动端start -->
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no" />
<meta name="apple-mobile-web-app-capable" content="yes" /><!-- 删除苹果默认的工具栏和菜单栏 -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" /><!-- 设置苹果工具栏颜色 -->
<meta name="format-detection" content="telphone=no, email=no" /><!-- 忽略页面中的数字识别为电话,忽略email -->
<!-- 启用360浏览器的极速模式(webkit) -->
<meta name="renderer" content="webkit" />
<!-- 避免IE使用兼容模式 -->
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<!-- 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓 -->

iOS 与 惯性滚动

注:以下所有例子均 在 iOS 的微信中测试过,但对于饿了么APP的内置浏览器同样适用(两者使用相同内核)

引题

工作中常常有需要显示大量信息的情况,列表超出一屏就涉及到滚动的问题。例如

- var n = 1