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
//jquery | |
//从后向前逐个删除末尾字符,直至元素的高度小于父元素高度 | |
$(".figcaption").each(function(i){ | |
var divH = $(this).height(); | |
var $p = $("p", $(this)).eq(0); | |
while ($p.outerHeight() > divH) { | |
$p.text($p.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "...")); | |
}; | |
}); |
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
/*For CSS background-images*/ | |
.yourselector { | |
width:200px; | |
height:100px; | |
background: url(/folder/yourimage.png) no-repeat; | |
_background:none; | |
_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='/folder/yourimage.png',sizingMethod='crop'); | |
} | |
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 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> | |
<title></title> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"/> | |
</head> | |
<body style="margin: 0; padding: 0;"> | |
<table border="1" cellpadding="0" cellspacing="0" width="100%"> |
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,body,h1,h2,h3,h4,h5,h6,div,dl,dt,dd,ul,ol,li,p,blockquote,pre,hr,figure,table,caption,th,td,form,fieldset,legend,input,button,textarea,menu{margin:0;padding:0;} | |
header,footer,section,article,aside,nav,hgroup,address,figure,figcaption,menu,details{display:block;} | |
table{border-collapse:collapse;border-spacing:0;} | |
html,body,fieldset,img,iframe,abbr{border:0;} | |
i,cite,em,var,address,dfn{font-style:normal;} | |
li{list-style:none;} |
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 toType = function(obj) { | |
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase() | |
}; |
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).ready(function() { | |
$("a.topLink").click(function() { | |
$("html, body").animate({ | |
scrollTop: $($(this).attr("href")).offset().top + "px" | |
}, { | |
duration: 500, | |
easing: "swing" | |
}); | |
return false; | |
}); |
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($) { | |
var cache = []; | |
// Arguments are image paths relative to the current page. | |
$.preLoadImages = function() { | |
var args_len = arguments.length; | |
for (var i = args_len; i--;) { | |
var cacheImage = document.createElement('img'); | |
cacheImage.src = arguments[i]; | |
cache.push(cacheImage); | |
} |
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
Ctrl+Shift+P:打开命令面板 | |
Ctrl+P:搜索项目中的文件 | |
Ctrl+G:跳转到第几行 | |
Ctrl+W:关闭当前打开文件 | |
Ctrl+Shift+W:关闭所有打开文件 | |
Ctrl+Shift+T: 打开刚刚关闭的标签 | |
Ctrl+Shift+V:粘贴并格式化 | |
Ctrl+D:选择单词,重复可增加选择下一个相同的单词 | |
Ctrl+L:选择行,重复可依次增加选择下一行 | |
Ctrl+Shift+L:选择多行 |
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($){ | |
$.fn.hoverDelay = function(options){ | |
var defaults = { | |
hoverDuring: 200, | |
outDuring: 200, | |
hoverEvent: function(){ | |
$.noop(); | |
}, | |
outEvent: function(){ | |
$.noop(); |