IIssNan's Notes

Quick notes


  • 首页

  • 归档

  • 标签

  • 搜索

Everything you always wanted to know about touch icons

发表于 2012-12-22 | | 阅读次数
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
<!-- For third-generation iPad with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed"
sizes="144x144"
href="apple-touch-icon-144x144-precomposed.png">
<!-- For iPhone with high-resolution Retina display: -->
<link rel="apple-touch-icon-precomposed"
sizes="114x114"
href="apple-touch-icon-114x114-precomposed.png">
<!-- For first- and second-generation iPad: -->
<link rel="apple-touch-icon-precomposed"
sizes="72x72"
href="apple-touch-icon-72x72-precomposed.png">
<!-- For non-Retina iPhone, iPod Touch, and Android 2.1+ devices: -->
<link rel="apple-touch-icon-precomposed"
href="apple-touch-icon-precomposed.png">

Compass

发表于 2012-12-21 | | 阅读次数

Compass is an open-source CSS Authoring Framework.

Compass uses Sass.

避免调用 console 相关方法在 IE6/7 等不支持的浏览器下报错

发表于 2012-12-19 | 分类于 技术水波文 | | 阅读次数

来自 HTML Boilerplate 前端框架的方法。

原理很简单:

  1. 判断 console 对象是否存在,不存在则新建:

    1
    var console = (window.console = window.console || {});
  2. 定义包含 console 对象方法名称的数组。迭代数组,判断 console 对象是否具有对应的方法,如果方法不存在,在 console 对象上新建此方法,并赋值空函数。

    1
    2
    3
    if (!console[method]) {
    console[method] = function() {};
    };

完整的代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Avoid `console` errors in browsers that lack a console.
(function() {
var method;
// 空函数
var noop = function noop() {};
// 预测console方法列表
var methods = [
'assert', 'clear', 'count', 'debug',
'dir', 'dirxml', 'error', 'exception',
'group', 'groupCollapsed', 'groupEnd', 'info',
'log', 'markTimeline', 'profile', 'profileEnd',
'table', 'time', 'timeEnd', 'timeStamp',
'trace', 'warn'
];
var length = methods.length;
var console = (window.console = window.console || {});
while (length--) {
method = methods[length];
// 如果console的此属性(方法)不存在,则将其设定为空函数
if (!console[method]) {
console[method] = noop;
}
}
}());

Using delegate with hover in jQuery

发表于 2012-12-13 | | 阅读次数
1
2
3
4
5
6
7
$("#myList").delegate("li", "hover", function ( event ) {
if (event.type == 'mouseenter') {
showButtons();
} else {
hideButtons();
}
});

Mateor

发表于 2012-09-21 | | 阅读次数

Meteor is an ultra-simple environment for building modern web applications.

With Meteor you write apps:

  • in pure Javascript
  • that send data over the wire, rather than HTML
  • using your choice of popular open-source libraries
1…242526…37
IIssNan

IIssNan

胡编一通,乱写一气

183 日志
6 分类
111 标签
RSS
GitHub Twitter 豆瓣 知乎
© 2011 - 2017 IIssNan
由 Hexo 强力驱动
主题 - NexT.Pisces
0%