View hoverHint.css
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
.hint {position:absolute;font:12px arial, 宋体;background:#2d2d2d;color:#f2f2f2;padding:6px 9px;border:1px solid #000;z-index: 999;margin-top:0.5em;} | |
.hint-content {position: relative;z-index: 1000;} | |
.hint i, .hint em {position: absolute;display: block;height: 0;width: 0;background: transparent;border: 6px solid transparent;z-index: 100;border-bottom-color: #000;top: -1em;left: 50%;margin-left: -0.5em;} | |
.hint i {border-bottom-color: #2d2d2d;z-index: 101;margin-top: 1px;} |
View a2c.js
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 toChineseNumeral(num){ | |
var numerals = { | |
'-':'负', | |
'.':'点', | |
0:'零', | |
1:'一', | |
2:'二', | |
3:'三', | |
4:'四', | |
5:'五', |
View Befunge.js
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 Befunge(code) { | |
var output = ''; | |
var stack = []; | |
var codeArray = code.split('\n'); | |
var x = 0; | |
var y = 0; | |
var d = code.charAt(0); | |
var next = d; | |
var cmd = 'NORMAL'; | |
var loop = true; |
View maybe.js
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 Maybe() { | |
Object.freeze(this); | |
} | |
function Just (x) { | |
this.toString = function () { return "Just " + x.toString(); }; | |
this.just = x; | |
Object.freeze(this); | |
} | |
Just.prototype = new Maybe(); |
View UriBuilder.js
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 UriBuilder(uri) { | |
this.uri = uri; | |
this.parse(); | |
return this; | |
} | |
UriBuilder.prototype.parse = function() { | |
// var match = this.uri.match(/(\w+:\/\/?.+?\..+\..+)?(\?.+)/); | |
var match = this.uri.split('?'); | |
var params, o = {},t; |
View GeneticAlgorithm
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 GeneticAlgorithm = function () {}; | |
GeneticAlgorithm.prototype.generate = function(length) { | |
var s = ''; | |
while (length--) { | |
s += ~~(Math.random()+0.5); | |
} | |
return s; | |
}; |
View functionList.js
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 List() {} | |
function EmptyList() {} | |
EmptyList.prototype = new List(); | |
EmptyList.prototype.constructor = EmptyList; | |
EmptyList.prototype.toString = function() { return '()'; }; | |
EmptyList.prototype.isEmpty = function() { return true; }; | |
EmptyList.prototype.length = function() { return 0; }; | |
EmptyList.prototype.push = function(x) { return new ListNode(x, this); }; |
View gist:cadb57395f0b83bede4e
无障碍的Web应用[ARIA]介绍专题
几个场景
- 一坨没有格式化的代码
- 一个无样式的页面
- 一个不支持鼠标操作的页面/表单
- 一部不带字幕的电影
- 一个由js/as生成的web页面[对蜘蛛而言]
- 一条通向“死路”的盲道
View index.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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Document</title> | |
<style> | |
body {padding:0 20px;margin: 0;font-family: '黑体', sans-serif;} | |
code {border: 1px solid #e3e3e3;padding: 1px 2px;} | |
#res {height: 5em;border: 1px solid #999;} | |
</style> |
OlderNewer