(function(doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function() {
var clientWidth = docEl.clientWidth;
if (!clientWidth) return;
if (clientWidth >= 640) {
docEl.style.fontSize = '100px';
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function isSafari() { | |
return navigator.userAgent.indexOf('Safari') > 0 && | |
navigator.userAgent.indexOf('Chrome') < 0; | |
} | |
function isIe() { | |
return navigator.userAgent.indexOf('MSIE') > 0; | |
; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ============================== START normalize.css ==============================*/ | |
/*! normalize.css v7.0.0 | MIT License | github.com/necolas/normalize.css */ | |
/** | |
* 1. Correct the line height in all browsers. | |
* 2. Prevent adjustments of font size after orientation changes in | |
* IE on Windows Phone and in iOS. | |
*/ | |
html { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var app = express(); | |
var http = require('http'); | |
var httpServer = http.Server(app); | |
app.all('*', function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "X-Requested-With"); | |
res.header("Access-Control-Allow-Methods","PUT,POST,GET,DELETE,OPTIONS"); | |
res.header("X-Powered-By",' 3.2.1'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function() { | |
/** | |
* 根据测试字体与基准字体拼接后字体的宽高 和 原来基准字体的宽高进行对比,若不同,则说明测试字体存在 | |
*/ | |
var Detector = function() { | |
// 传入的字体会和下面三种字体作比较 | |
var baseFonts = ['monospace', 'sans-serif', 'serif']; | |
// 使用m和w作为测试字符因为它们占据最大宽度 | |
var testString = "mmmmmmmmmmlli"; |
- 例1(小米米官网):font: 14px/1.5 "Helvetica Neue",Helvetica,Arial,"Microsoft Yahei","Hiragino Sans GB","Heiti SC","WenQuanYi Micro Hei",sans-serif;
- 例2(淘宝技术研发中心):font: 12px/1.5 tahoma,arial,'Hiragino Sans GB','\5b8b\4f53',sans-serif;
- 例3(加网 ):font: 14px/1.5 'Microsoft YaHei',arial,tahoma,\5b8b\4f53,sans-serif;
- 例4(淘宝UED):font: 12px/1 Tahoma,Helvetica,Arial,"\5b8b\4f53",sans-serif;
- 例5(一淘UX):font-family: Helvetica, 'Hiragino Sans GB', 'Microsoft Yahei', '微软雅黑', Arial, sans-serif;
- 例6(简书):font-family: "lucida grande", "lucida sans unicode", lucida, helvetica, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<!-- 声明文档使用的字符编码 --> | |
<meta charset='utf-8'> | |
<!-- 优先使用 IE 最新版本和 Chrome --> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/> | |
<!-- 页面描述 --> | |
<meta name="description" content="不超过150个字符"/> | |
<!-- 页面关键词 --> | |
<meta name="keywords" content=""/> |
NewerOlder