- 960 Grid System - An effort to streamline web development workflow by providing commonly used dimensions, based on a width of 960 pixels. There are two variants: 12 and 16 columns, which can be used separately or in tandem.
- Compass - Open source CSS Authoring Framework.
- Bootstrap - Sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.
- Font Awesome - The iconic font designed for Bootstrap.
- Zurb Foundation - Framework for writing responsive web sites.
- SASS - CSS extension language which allows variables, mixins and rules nesting.
- Skeleton - Boilerplate for responsive, mobile-friendly development.
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 isPhone(val) { | |
if (!/^(((13[0-9]{1})|159|180|181|186|189|(15[0-9]{1}))+\d{8})$/.test(val)) { | |
return false; | |
} else { | |
return true; | |
} | |
} |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
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
/* 滚动条 */ | |
::-webkit-scrollbar-thumb:horizontal { /*水平滚动条的样式*/ | |
width: 5px; | |
background-color: #CCCCCC; | |
-webkit-border-radius: 6px; | |
} | |
::-webkit-scrollbar-track-piece { | |
background-color: #fff; /*滚动条的背景颜色*/ | |
-webkit-border-radius: 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
// 判断滚动条是否已经到页面底部 | |
$(window).scroll(function() { | |
var scrollTop = $(this).scrollTop(); | |
var scrollHeight = $(document).height(); | |
var windowHeight = $(this).height(); | |
if (scrollTop + windowHeight == scrollHeight) { | |
console.log('滚动条已经到达页面底部'); | |
} | |
}); |
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 myArray = [12 , 222 , 1000 ]; | |
myArray.length = 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
var numbers = [5, 458 , 120 , -215 , 228 , 400 , 122205, -85411]; | |
numbers = numbers.sort(function(){ return Math.random() - 0.5}); |
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 generateRandomAlphaNum(len) { | |
var rdmString = ""; | |
for( ; rdmString.length < len; rdmString += Math.random().toString(36).substr(2)); | |
return rdmString.substr(0, len); | |
} |
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 ramdom(min, max) { | |
if (max == null) { | |
max = min; | |
min = 0; | |
} | |
return min + Math.floor(Math.random() * (max - min + 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
<canvas width="300" height="300" id="test"></canvas> | |
<script type="text/javascript"> | |
var canvas = document.getElementById('test'); | |
var ctx = canvas.getContext('2d'); | |
//绘制螺旋图案的函数 | |
function drawSpirograph(ctx,R,r,O){ | |
var x1 = R-O; | |
var y1 = 0; | |
var i = 1; |
NewerOlder