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
document.addEventListener('WeixinJSBridgeReady', function(){ | |
//如果执行到这块的代码,就说明是在微信内部浏览器内打开的. | |
alert('当前页面在微信内嵌浏览器中打开!'); | |
}); |
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
[ | |
{ | |
"spec name": "CSS Animations", | |
"uri": "http://www.w3.org/TR/css3-animations", | |
"category": "css-property", | |
"Name": "animation-name", | |
"Value": "<single-animation-name> [\n ‘,’ <single-animation-name> ]*", | |
"Initial": "‘none’", | |
"Applies To": "all elements, ::before and ::after pseudo-elements", | |
"Inherited": "no", |
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
// XXX should be standard (and named clone, after Java?) | |
Object.prototype.copy = function () { | |
let o = {} | |
for (let i in this) | |
o[i] = this[i] | |
return o | |
} | |
// Containment testing for arrays and strings that should be coherent with their iterator. | |
Array.prototype.contains = String.prototype.contains = function (e) { |
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
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
// MIT license | |
(function() { | |
var lastTime = 0; | |
var vendors = ['ms', 'moz', 'webkit', 'o']; |
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 forEach = [].forEach, | |
regex = /^data-(.+)/, | |
dashChar = /\-([a-z])/ig, | |
el = document.createElement('div'), | |
mutationSupported = false, | |
match | |
; | |
function detectMutation() { |