This file contains hidden or 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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0"> | |
<title>Auto play html audio in iOS WeChat InAppBrowser the right way</title> | |
</head> | |
<body> | |
<h1>在 iOS 微信浏览器中自动播放 HTML5 audio(音乐) 的正确方式</h1> | |
<p>核心原理: 在微信的JS-API 中 play 一下 audio 即可达到自动播放的目的(应该是微信自己做了处理)</p> |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<script id="jsbin-javascript"> | |
alert(1); |
This file contains hidden or 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 onBlur() { | |
document.body.className = 'blurred'; | |
}; | |
function onFocus(){ | |
document.body.className = 'focused'; | |
}; | |
if (/*@cc_on!@*/false) { // check for Internet Explorer | |
document.onfocusin = onFocus; | |
document.onfocusout = onBlur; |
This file contains hidden or 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 gulp = require('gulp'); | |
var coffee = require('gulp-coffee'); | |
var usemin = require('gulp-usemin'); | |
var uglify = require('gulp-uglify'); | |
var cssmin = require('gulp-minify-css'); | |
var sass = require('gulp-sass'); | |
var clean = require('gulp-clean'); | |
var cheerio = require('gulp-cheerio'); | |
var srcPath = { |
This file contains hidden or 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 _IE = (function() { | |
var v = 3, | |
div = document.createElement('div'), | |
all = div.getElementsByTagName('i'); | |
while ( | |
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->', | |
all[0]); | |
return v > 4 ? v : false; | |
}()); |
This file contains hidden or 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
lazyLoad = (function() { | |
var map_element = {}; | |
var element_obj = []; | |
var download_count = 0; | |
var last_offset = -1; | |
var doc_body; | |
var doc_element; | |
var lazy_load_tag; | |
function initVar(tags) { |
This file contains hidden or 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 EventUtil={ | |
addHandler:function(element,type,handler){ | |
if(element.addEventListener){ | |
element.addEventListener(type,handler,false); | |
}else if(element.attachEvent){ | |
element.attachEvent("on"+type,handler); | |
}else{ | |
element["on"+type]=handler; | |
} | |
}, |
This file contains hidden or 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($) { | |
$.fn.slide = function(options) { | |
var defaults = { | |
speed: 5000 //ms | |
}; | |
var opts = $.extend({}, defaults, options); | |
return this.each(function() { | |
var _this = $(this); | |
var _child = $("li", _this); | |
var _length = _child.size(); |
This file contains hidden or 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($) { | |
//选项卡 | |
$.fn.tab = function(options) { | |
var defaults = { | |
classname: "news-content", | |
speed: "100", | |
evt: "mouseover" | |
}; | |
var opts = $.extend({}, defaults, options); |
This file contains hidden or 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() { | |
function getCookie(name) { | |
var cookie = document.cookie; | |
var s = removeBlanks(cookie); | |
var pairs = s.split(";"); | |
for (var i = 0; i < pairs.length; i++) { | |
var pairSplit = pairs[i].split("="); | |
if (pairSplit.length > 1 && pairSplit[0] == name) { | |
return pairSplit[1]; | |
} |
NewerOlder