Skip to content

Instantly share code, notes, and snippets.

<!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>
@janily
janily / dabblet.css
Created July 31, 2013 01:10 — forked from kejun/dabblet.css
环形进度条,css bt版
/**
* 环形进度条,css bt版
*/
html,body { height:100%; }
body {
display: flex;
justify-content: center;
align-items: center;
}
#!/bin/bash
PROGNAME=${0##*/}
INPUT=''
QUIET='0'
NOSTATS='0'
max_input_size=0
max_output_size=0
usage()
@janily
janily / footerstick
Created July 31, 2013 12:27
页脚固定在底部
<div id="container">
<div id="content">页面正文</div>
</div>
<div class="footer">我在底部</div>
html, body{
height:100%;
}
#container {
min-height:100%; /*使内容高度和body一样*/
@janily
janily / ie version
Created August 2, 2013 04:12
判断ie版本号
var _IE = (function(){
var v = 3, div = document.createElement('div'), all = div.getElementsByTagName('i');
while (
div.innerHTML = '<!--[if gt IE ' + (++v) + ']><i></i><![endif]-->',
all[0]
);
return v > 4 ? v : false ;
}());
.flex-container {
display:-webkit-flex;
display:flex;
-webkit-flex-wrap: wrap;
}
.flex-item {
padding: 0 2.5%;
width: 28.33%;
-webkit-flex: auto;
}
<div class="container">
<form class="form-signin form-horizontal" method="post" action="/login">
<h2 class="">Please sign in</h2>
<div class="control-group ">
<label class="control-label" for="email">Email:</label>
<div class="controls">
<input type="text" id="email" name="email" placeholder="Email address" value="">
</div>
</div>
@janily
janily / shift.js
Created August 6, 2013 02:10 — forked from sofish/shift.js
// 顺延函数:如果上一个动作完成,则当前动作替换上一个
function shift(fn, time) {
time = time || 50;
var queue = this._shift_fn, current;
queue ? queue.concat([fn, time]) : (queue = [[fn, time]]);
current = queue.pop();
clearTimeout(this._shift_timeout);
this._shift_timeout = setTimeout(function() {
@janily
janily / dateformat
Created August 6, 2013 06:34
日期格式化函数 使用方法 dateFormat('yyyy-MM-dd hh:mm:ss'); dateFormat(new Date(), 'yyyy-MM-dd hh:mm:ss');
/**
* 对日期进行格式化,
* @param date 要格式化的日期
* @param format 进行格式化的模式字符串
* 支持的模式字母有:
* y:年,
* M:年中的月份(1-12),
* d:月份中的天(1-31),
* h:小时(0-23),
* m:分(0-59),
@janily
janily / sort.js
Created August 7, 2013 06:12 — forked from sofish/sort.js
// firefox 和 chrome 是 [1024, 6, 5, 3, 2, 1]
// safari 中顺序没变
[1,3,2,5,6,1024].sort(function(a, b) {
return b > a;
});
// 在各中浏览器工作一致的方法
// 用正负和零来排序,而不是 true/false
[1,3,2,5,6,1024].sort(function(a, b) {