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
// ---- | |
// libsass (v0.7.0) | |
// ---- | |
// 1 变量(以$开头) | |
$blue : #1875e7; | |
div { | |
color : $blue; | |
} | |
// 1.1 变量在字符串中#{} |
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
// ---- | |
// libsass (v0.7.0) | |
// ---- | |
// 1 变量(以$开头) | |
$blue : #1875e7; | |
div { | |
color : $blue; | |
} | |
// 1.1 变量在字符串中#{} |
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
// ---- | |
// libsass (v0.7.0) | |
// ---- | |
// 1 变量(以$开头) | |
$blue : #1875e7; | |
div { | |
color : $blue; | |
} | |
// 1.1 变量在字符串中#{} |
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
/************************************************************** | |
* Dog相当一个命名空间,不能够产生实例 | |
**************************************************************/ | |
var Dog = { | |
name: '', | |
getName: function(){ | |
return this.name; | |
}, | |
setName: function(name){ | |
this.name = name; |
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).bind("contextmenu", function(){ | |
return false; | |
}); | |
//捕获回车事件 | |
$(document).keydown(function(event){ | |
if(event.keyCode==13){ | |
console.log('Enter '); | |
} | |
}); |
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
//过滤html标签 | |
'<a href="#" id="test"><span>test text</a></span>'.replace(/<.*?>/g, '') // 返回'test text' | |
//获取后缀名(有问题) | |
'eoopen.apply.file.jpeg'.match(/.[^.]+$/); // ok, 返回 [".jpeg"] | |
'eoopen-apply-file-jpeg'.match(/.[^.]+$/); // error,返回 ["eoopen-apply-file-jpeg"] | |
'eoopen-apply-file-jpeg.'.match(/.[^.]+$/); // error,返回 null | |
var pattern = /java/ig; | |
var text = 'Java is more fun than javascript!'; |
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 getStr(str, len){ | |
var len = 0; | |
for (var i=0; i<str.length; i++) { | |
var c = str.charCodeAt(i); | |
if ((c >= 0x0001 && c <= 0x007e) || (0xff60<=c && c<=0xff9f)) { | |
len++; | |
} | |
else { | |
len+=2; | |
} |
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
/* | |
* @Author: xngiser | |
* @Date: 2013-11-28 10:50:04 | |
* @Email: ggiiss@qq.com | |
* @Last Modified by: xngiser | |
* @Last Modified time: 2013-11-29 21:32:48 | |
*/ | |
(function(window, $, eo){ | |
/*********************************************************************** |
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 getSuffixIcon = function(type){ | |
var icon ='unknow'; | |
var suffix = { | |
image:['jpg','png','gif','jpeg'], | |
doc:['doc','docx'], | |
rar:['rar','zip','tar','gz','7z','tar.gz'], | |
xls:['csv','xls'] | |
} | |
for(var k in suffix){ | |
if($.inArray(type, suffix[k]) > -1){ |
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
/** | |
* @author Dongxu Huang \ shuke | |
*/ | |
var isAlpha = function(str) { | |
return/[a-zA-Z']+/.test(str) | |
}; | |
document.addEventListener("mousemove", update_mouse_pos, true); | |
document.addEventListener("mouseup", on_mouse_up, true); | |
document.addEventListener("mousedown", on_mouse_down, true); |