Skip to content

Instantly share code, notes, and snippets.

View MrPeak's full-sized avatar
🎯
Focusing

转二 MrPeak

🎯
Focusing
View GitHub Profile
@MrPeak
MrPeak / app.js
Created December 27, 2013 06:05
A fixed navigation demo which depended on jQuery. desc: http://jsfiddle.net/mrpeak/BTdY9/1/
$(function () {
$('#navigation a').stop().animate({
'marginLeft': '-85px'
}, 1000);
$('#navigation > li').hover(
function () {
$('a', $(this)).stop().animate({
'marginLeft': '-2px'
@MrPeak
MrPeak / CommonJs in Front&Back End
Created December 12, 2013 06:11
A compatible solution for server & browser javascript.
;(function(libName, libBody) {
var hasDefine = typeof define === 'function';
hasExports = typeof module !== "undefined" && module.exports;
if(hasDefine) {
if(define.AMD) {
// AMD environment
define(libBody);