朴灵的 EventProxy, README 里有个例子:
var proxy = new EventProxy();
var render = function (template, data, l10n){
_.template(template, data);
};
proxy.assign("template", "data", "l10n", render);
$.get("template", function (template) {
// something
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Single and Double Click</title> | |
<link rel="stylesheet" type="text/css" href="style.css"> | |
</head> | |
<body> | |
<div id="the_div"></div> | |
<span>Double click the block</span> |
// 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']; |
// Lack of tail call optimization in JS | |
var sum = function(x, y) { | |
return y > 0 ? sum(x + 1, y - 1) : | |
y < 0 ? sum(x - 1, y + 1) : | |
x | |
} | |
sum(20, 100000) // => RangeError: Maximum call stack size exceeded | |
// Using workaround |
var http = require("http"), | |
url = require("url"), | |
path = require("path"), | |
fs = require("fs"), | |
mime = require("mime") | |
port = process.argv[2] || 8888; | |
http.createServer(function(request, response) { | |
var uri = url.parse(request.url).pathname |
朴灵的 EventProxy, README 里有个例子:
var proxy = new EventProxy();
var render = function (template, data, l10n){
_.template(template, data);
};
proxy.assign("template", "data", "l10n", render);
$.get("template", function (template) {
// something
The list would not be updated for now. Don't write comments.
The count of contributions (summary of Pull Requests, opened issues and commits) to public repos at GitHub.com from Wed, 21 Sep 2022 till Thu, 21 Sep 2023.
Because of GitHub search limitations, only 1000 first users according to amount of followers are included. If you are not in the list you don't have enough followers. See raw data and source code. Algorithm in pseudocode:
githubUsers
// oldj:设 A = $("#id a"),B = $("#id .c a"),求 A - B。要求: | |
// 1、不能用 jQuery 等框架; | |
// 2、兼容 IE6 在内的各大浏览器; | |
// 3、尽可能高效; | |
// 4、尽可能简短。 | |
function getWanted() { | |
var root = document.getElementById('id') | |
var all = root.getElementsByTagName('*') |
var a = document.createElement('a'); | |
a.href = '/test/hello/world'; | |
alert(a.pathname) |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta charset="UTF-8"> | |
<title>css</title> | |
<style> | |
a{display:table-cell;background:green;vertical-align:bottom;padding-left:10px;padding-bottom:5px;height:130px;width:250px;} | |
a:hover{-moz-transition:all ease-in 1s;-webkit-transition:all ease-in 1s;transition:all ease-in 1s;background:#8fc;font-size:40px;} | |
</style> | |
</head> |
.mod { | |
position: absolute; | |
width: 300px; | |
background: #eee; | |
border: 1px solid #eee; | |
padding: 0 50px; | |
-webkit-box-shadow: 0 0 4px 0 rgba(0,0,0,0.2); | |
-moz-box-shadow: 0 0 4px 0 rgba(0,0,0,0.2); | |
box-shadow: 0 0 4px 0 rgba(0,0,0,0.2); | |
top: 50%; |