####stellar.js
代码简单,只有651行,依赖jQuery,配置简便
仓库地址:
https://github.com/markdalgleish/stellar.js
demo地址:
// add this inlined to <head> and before all <links> | |
<script> | |
(function(document,navigator,standalone) { | |
// prevents links from apps from oppening in mobile safari | |
// this javascript must be the first script in your <head> | |
if ((standalone in navigator) && navigator[standalone]) { | |
var curnode, location=document.location, stop=/^(a|html)$/i; | |
document.addEventListener('click', function(e) { | |
curnode=e.target; | |
while (!(stop).test(curnode.nodeName)) { |
/*jslint debug: true, | |
undef: false */ | |
;(function(win, doc){ | |
var localStorageName = 'localStorage'; | |
var _util = { | |
isLocalStorageNameSupported: function() { | |
// 加try{}catch(){}的为了防止Firefox浏览器改配置dom.Storage = false时crash掉 | |
try { return (localStorageName in win && win[localStorageName]) } | |
catch(err) { return false } | |
}, |
####stellar.js
代码简单,只有651行,依赖jQuery,配置简便
仓库地址:
https://github.com/markdalgleish/stellar.js
demo地址:
function throttle( fn, time ) { | |
var t = 0; | |
return function() { | |
var args = arguments, ctx = this; | |
clearTimeout(t); | |
t = setTimeout( function() { | |
fn.apply( ctx, args ); | |
}, time ); | |
}; |
define(['module'], function (module) { | |
'use strict'; | |
var storage = (function(){ | |
var uid = new Date, | |
result; | |
try { | |
localStorage.setItem(uid, uid); | |
result = localStorage.getItem(uid) == uid; | |
localStorage.removeItem(uid); |
// Feature detect + local reference | |
var storage, | |
fail, | |
uid; | |
try { | |
uid = new Date; | |
(storage = window.localStorage).setItem(uid, uid); | |
fail = storage.getItem(uid) != uid; | |
storage.removeItem(uid); | |
fail && (storage = false); |
!SLIDE | |
# 前端组2012Q4工作总结 - 巩守强 | |
!SLIDE | |
## | |
[Picture Show ためしてみたお( ^ω^) ](http://d.hatena.ne.jp/xuwei/20110903/1315044919) |
// Combine JS and CSS files | |
// --- | |
// | |
// Make sure you install the npm dependencies | |
// > cd YOUR_PROJECT_FOLDER | |
// > npm install | |
// | |
// Than run: | |
// > node build |
/* mkdir -p for node */ | |
var fs = require('fs'), | |
path = require('path'); | |
function mkdirpSync (pathes, mode) { | |
mode = mode || 0777; | |
var dirs = pathes.trim().split('/'); | |
if (dirs[0] == '.') { | |
// ./aaa | |
dirs.shift(); |
var source ='\ | |
{{#each types.type}}\ | |
<h2>{{this}}</h2>\ | |
<p>{{#test ../this }}{{/test}}</p>\ | |
{{/each}}\ | |
' | |
var data = { | |
types: { | |
type: [ | |
'o', 'k' |