Skip to content

Instantly share code, notes, and snippets.

View paddingme's full-sized avatar
🛵
Drifting down a road

PaddingMe paddingme

🛵
Drifting down a road
View GitHub Profile
@paddingme
paddingme / countdown.js
Created October 30, 2015 02:30 — forked from mingyun/countdown.js
jquery倒计时插件
$(document).ready(function () {
/* 延迟函数 */
jQuery.fn.delay = function (time, func) {
return this.each(function () {
setTimeout(func, time);
});
};
jQuery.fn.countDown = function (settings, to) {
settings = jQuery.extend({
startFontSize: '36px',
function get(uri) {
return http(uri,'GET');
}
function post(uri,data) {
if(typeof data === 'object' && !(data instanceof String || (FormData && data instanceof FormData))) {
var params = [];
for(var p in data) {
if(data[p] instanceof Array) {
for(var i = 0; i < data[p].length; i++) {
params.push( encodeURIComponenet(p) + '[]=' + encodeURIComponenet(data[p][i]);
<!DOCTYPE html>
<head>
<title>Stay Standalone</title>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<script src="stay_standalone.js" type="text/javascript"></script>
</head>
<body>
<ul>
<li><a href="http://google.com/">Remote Link (Google)</a></li>
@paddingme
paddingme / insertAfter
Created November 19, 2014 02:16
在现有元素后插入一个新元素
function insertAfter(newElement,targetElement){
var parent = targetElement.parentNode;
if(parent.lastChild == targetElement){
parent.appendChild(newElement);
} else {
parent.insertBefore(newElement,targetElement.nextSibling);
}
@paddingme
paddingme / addLoadEvent
Last active August 29, 2015 14:09
addLoadEvent
//把现有的 window.onload 事件处理函数的值存入变量 oldonload;
//若在这个处理函数上还没有绑定任何函数,就像平时那样把新函数添加给它;
//若在这个处理函数上已经绑定了一些函数,就把新函数追加到现有指令的末尾。
function addLoadEvent(func){
var oldonload = window.onload;
if(typeof window.onload != 'function') {
window.onload = func;
} else {
@paddingme
paddingme / code is far away from bug with the animal protecting
Last active August 29, 2015 14:09
code is far away from bug with the animal protecting 
/*
        ┏┓   ┏┓
       ┏┛┻━━━┛┻┓
       ┃       ┃  
       ┃   ━   ┃
       ┃ >   < ┃
       ┃       ┃
       ┃... ⌒ ... ┃
       ┃       ┃
@paddingme
paddingme / first.js
Last active August 29, 2015 14:08 — forked from sofish/first.js
// 大家写在评论中吧,代码高亮可以这样写:
// ```js
// your code
// ```
// update: Fri Aug 31 08:39:21
// copyright: https://gist.github.com/3549352
// 加个性能测试:http://jsperf.com/get-dom-s-first-element
var util = {};
@paddingme
paddingme / li background-image
Created September 29, 2014 14:25
li 设置背景图片 位置 设置序号
CSS CODE
ul
{
list-style-type: none;
padding: 0;
margin: 0;
text-align: right;
}
li
@paddingme
paddingme / Reset CSS
Created September 29, 2014 14:20
Reset CSS
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@paddingme
paddingme / CSS Reset
Last active August 29, 2015 14:07
CSS Reset
/*http://www.zhangxinxu.com/study/200912/css-tools-css-reset.html */
/* v1.0 | 20080212 */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,