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
// ---- | |
// Sass (v3.3.9) | |
// Compass (v1.0.0.alpha.20) | |
// ---- | |
/* 学习 Sass */ | |
/* 变量 */ | |
$font-yahei: "microsoft yahei"; | |
$main-color: #333; |
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 isCurrentWeek(ts) { | |
var now = new Date(); | |
now.setHours(0); | |
now.setMinutes(0); | |
now.setSeconds(0); | |
var nowTS = now.getTime(); | |
var nowDay = getWeekNum(now.getDay()); | |
function getWeekNum(week) { | |
return week === 0 ? 7 : week; |
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 nWeekFromNow(ts) { | |
var now = new Date(); | |
now.setHours(0); | |
now.setMinutes(0); | |
now.setSeconds(0); | |
now.setMilliseconds(0); | |
var nowTS = now.getTime(); | |
var nowDay = now.getDay() || 7; | |
var startTS = nowTS - (nowDay - 1) * 24 * 60 * 60 * 1000; |
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 inSomeWeek(ts, n) { | |
var now = new Date(); | |
now.setHours(0); | |
now.setMinutes(0); | |
now.setSeconds(0); | |
var nowTS = now.getTime(); | |
var nowDay = getWeekNum(now.getDay()); | |
function getWeekNum(week) { | |
return week === 0 ? 7 : week; |
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
// ---------------------------------------------------------- | |
// A short snippet for detecting versions of IE in JavaScript | |
// without resorting to user-agent sniffing | |
// ---------------------------------------------------------- | |
// If you're not in IE (or IE version is less than 5) then: | |
// ie === undefined | |
// If you're in IE (>=5) then you can determine which version: | |
// ie === 7; // IE7 | |
// Thus, to detect IE: | |
// if (ie) {} |
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
/*Make position:fixed work in IE6!*/ | |
.fixed-top /* position fixed Top */{position:fixed;bottom:auto;top:0;} | |
.fixed-bottom /* position fixed Bottom */{position:fixed;bottom:0;top:auto;} | |
.fixed-left /* position fixed Left */{position:fixed;right:auto;left:0;} | |
.fixed-right /* position fixed right */{position:fixed;right:0;left:auto;} | |
* html,* html body /* IE6 Fixed Position Jitter Fix */{background-image:url(about:blank);background-attachment:fixed;} | |
* html .fixed-top /* IE6 position fixed Top */{position:absolute;bottom:auto;top:expression(eval(document.documentElement.scrollTop));} | |
* html .fixed-right /* IE6 position fixed right */{position:absolute;right:auto;left:expression(eval(document.documentElement.scrollLeft+document.documentElement.clientWidth-this.offsetWidth)-(parseInt(this.currentStyle.marginLeft,10)||0)-(parseInt(this.currentStyle.marginRight,10)||0));} |
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
// Array Remove - By John Resig (MIT Licensed) | |
Array.prototype.remove = function(from, to) { | |
var rest = this.slice((to || from) + 1 || this.length); | |
this.length = from < 0 ? this.length + from : from; | |
return this.push.apply(this, rest); | |
}; |
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 store = function(days) { | |
if ( typeof localStorage == 'undefined' ) { | |
var obj = document.createElement('q'), | |
days = days || 365; | |
obj.style.display = 'none'; | |
obj.addBehavior('#default#userData'); | |
var exp = new Date(); | |
exp.setDate(exp.getDate() + days) |
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 ($) { | |
/** | |
* pluginName插件 | |
*/ | |
var pluginName = function (that, options, callback) { | |
this.opts = $.extend({ | |
content: that.title || '', | |
options: 'you want to set' |
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 insertRandom = function(sign) { | |
// 默认给含[diy-random] class 的元素添加点击事件 | |
var class_name = sign || 'diy-random'; | |
$('.' + class_name).livequery('click', function(e) { | |
var $this = $(e.target), | |
href = $(this).attr('href'), | |
random = (+new Date()), res; | |
if ( href.indexOf('?')>-1 ) { |
OlderNewer