Skip to content

Instantly share code, notes, and snippets.

View liveme's full-sized avatar
🎯
Focusing

David liveme

🎯
Focusing
View GitHub Profile
;(function($) {
'use strict';
/**
* Multiple parallel getScript
*
* @access public
* @param Array|String url (one or more URLs)
* @param callback fn (oncomplete, optional)
* @returns void
(function() {
var script,
scripts = document.getElementsByTagName('script')[0];
function load(url) {
script = document.createElement('script');
script.async = true;
script.src = url;
scripts.parentNode.insertBefore(script, scripts);
@liveme
liveme / 0_reuse_code.js
Created March 21, 2014 06:56
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@liveme
liveme / reset.css
Created March 21, 2014 06:22
reset
/**
* @ Name: reset.css V1.0.0
* @ Author: liveme
* @ Update: 2013-10-25
* @ Copyright: 基于 normalize.css | MIT License
*/
/* =============== 基础排版 =============== */
html {
font-size: 62.5%; /* 10/16=62.5% */
@liveme
liveme / border-arrow.css
Created March 21, 2014 06:17
border三角形组件
/*
*@ Name: border三角形组件
*@ Update: 2013-08-04
*/
.arrow {
font-size: 0;
width: 0;
height: 0;
line-height: 0;
@liveme
liveme / txt-hide.css
Created March 21, 2014 06:17
图片替换之隐藏文字
/*
*@ Name: 图片替换之隐藏文字[版本1]
*@ Desc: 普通文字隐藏
*@ Update: 2013-05-23
*@ Doc: http://www.zeldman.com/2012/03/01/replacing-the-9999px-hack-new-image-replacement/
*/
.txt-hide {
text-indent: 100%; /* text-indent:-999em 存在性能问题 */
white-space: nowrap;
@liveme
liveme / inline-block.css
Created March 21, 2014 06:16
inline-block清除空隙
/*
*@ Name: display: inline-block;
*@ Update: 2013-06-27
*@ Doc: http://www.iyunlu.com/view/css-xhtml/64.html
*@ Usage: 若需清除空隙,则在外层容器加上 .dib-wrap
*/
.dib {
display: inline-block;
*display: inline;
@liveme
liveme / img-hide.css
Last active August 29, 2015 13:57
图片替换之隐藏文字
/*
*@ Name: 图片替换之隐藏文字[版本2]
*@ Desc: 图片加载完之前会显示文字,有利于ARIA
*@ Update: 2013-05-23
*@ Doc: http://www.iyunlu.com/view/css-xhtml/62.html
*@ Example: <a href="#" class="logo ir-warp"><span classs="ir">home page</span></a>
* .logo {
* width: 100px;
* height: 40px;
* *background: url(../imgs/logo.jpg) no-repeat 0 0;
@liveme
liveme / onepx.css
Last active August 29, 2015 13:57
IE6下1px高度
/*
*@ Name: IE6下1px高度
*@ Update: 2013-03-26
*@ Usage: 在目标元素之间加一个空格的转义符 &nbsp; ,如:<div class="onepx">&nbsp;</div>
* 或者考虑使用 1px 的 border-top 去代替。
*/
.onepx {
height: 1px;
line-height:1px;
@liveme
liveme / eq-layout.css
Last active August 29, 2015 13:57
等高布局
/*
*@ Name: 等高布局
*@ Update: 2013-03-26
*@ Usage:
* <div class="main eq-wrap">
* <div class="content eq-bd">content</div>
* <div class="aside eq-bd">aside</div>
* </div>
*/