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() { | |
countDown(); | |
}); | |
function countDown() { | |
var startTime = new Date(), | |
endTime = new Date('March 9,2014, 00:00:00'), | |
diff = endTime - startTime, | |
times = 24 * 60 * 60 * 1000, | |
day = Math.floor(diff / times), |
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 isElement(e) { | |
if (e && e.nodeType === 1) { | |
try { | |
e.nodeType = e.nodeType; | |
} catch(n) { | |
return true; | |
} | |
} | |
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
// DOM Node 判定 | |
function isDomNode(e){ | |
if((e && typeof(e.nodeType) == 'number') || e === null){ | |
try{ | |
e.nodeType = e.nodeType; | |
}catch(n){ | |
return true; | |
} | |
} | |
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 $window = $(window), | |
$info = $('#info'), | |
offset = $info.offset(), | |
rightV = rightVal(); | |
function rightVal() { | |
return ($window.width() - 960) / 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
.elem:after { | |
content: ""; | |
display: table; | |
clear: both; | |
} |
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 isNumber(n) { | |
if ( typeof(n) != 'number' && typeof(n) != 'string' ) { | |
return false; | |
} else { | |
return ( n == parseFloat(n) && isFinite(n) ); | |
} | |
} |
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 isIE = function() { | |
var ua = window.navigator.userAgent; | |
var ie = ua.match(/MSIE/) || ua.match(/Trident/); | |
return ie? true: 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
var DOMTreeUtil = (function() { | |
var visitAll = function(root, func) { | |
_visit(root, func); | |
}; | |
var _visit = function(elem, func) { | |
if (!elem.hasChildNodes) return; | |
var i, l; | |
var child = elem.childNodes; | |
for (i = 0, l = child.length; i < l; i++) { | |
func(child[i]); |
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
gi bower,node,osx,sass,sublimetext,vim,windows >> .gitignore |
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 MM = window.matchMedia("(max-width: 400px)"), | |
docbody = document.body; | |
function doMediaCheck () { | |
if (MM.matches) { | |
docbody.innerHTML = 'less than 400'; | |
docbody.className = 'orange'; | |
} else { | |
docbody.innerHTML = 'more than 400'; | |
docbody.className = ''; |
OlderNewer