Skip to content

Instantly share code, notes, and snippets.

@yijian166
yijian166 / dabblet.css
Created December 17, 2012 03:41
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
background: #f06;
background: linear-gradient(45deg, #f06, yellow);
min-height: 100%;
@yijian166
yijian166 / dabblet.css
Created December 17, 2012 03:43 — forked from LeaVerou/dabblet.css
Pounding heart animation
/* Pounding heart animation */
@keyframes pound {
to { transform: scale(1.4); }
}
.heart {
display: inline-block;
font-size: 150px;
color: #e00;
@yijian166
yijian166 / 0_reuse_code.js
Created April 17, 2014 02:29
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
@yijian166
yijian166 / Universal Internet Explorer 6 CSS.css
Created April 17, 2014 04:37
Universal Internet Explorer 6 CSS
/* --------------------------------------------------------------
Universal Internet Explorer 6 stylesheet:
http://stuffandnonsense.co.uk/blog/about/universal_internet_explorer_6_css/
Author: Andy Clarke
Web site: http://stuffandnonsense.co.uk
Web site: http://forabeautifulweb.com
Web site: http://transcending.com
Web site: http://hardboiledwebdesign.com
Twitter: http://twitter.com/malarkey
* {
-webkit-user-select:none; /* Prevent copy paste for all elements except text fields */
-webkit-tap-highlight-color:rgba(0, 0, 0, 0); /* set highlight color for user interaction */
-moz-tap-highlight-color:rgba(0, 0, 0, 0); /* set highlight color for user interaction */
-ms-touch-action:none;
-moz-user-select:-moz-none;
-webkit-touch-callout: none; /* prevent the popup menu on any links*/
margin:0;
padding:0;
-webkit-box-sizing:border-box;
@yijian166
yijian166 / gist:934ce36673921d8af8e2
Created May 21, 2014 03:44
js 判断对象相同
//1) https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is
var isSame = Object.is(value1, value2);
//2) Fast and limited.
//The ORDER of the properties IS IMPORTANT
JSON.stringify(obj1) === JSON.stringify(obj2) ;
//3) Slow and more generic.
function deepCompare () {
(function(){
/**
 * 功能:图片惰性加载。在需要图片惰性加载的页面底部载入。再将图片加上class=“lazy”。并将图片的真实地址放置在图片的自定义属性dataimg中。
 * @author haunghm
 * @version 1.0.0
 * @dependencies jquery 或者 zepto
 */
var lazyLoad = {
 
init: function() {
@yijian166
yijian166 / gist:319a5ff5387091875bad
Last active August 29, 2015 14:01
清除浮动——bootstrap
.clearfix {
*zoom: 1;
&:before,
&:after {
display: table;
content: "";
}
&:after {
clear: both;
}
@yijian166
yijian166 / app.js
Last active August 29, 2015 14:06 — forked from jgoux/app.js
angular.module('myApp', ['ionic', 'myApp.services', 'myApp.controllers'])
.run(function(DB) {
DB.init();
});
@yijian166
yijian166 / detector
Created July 2, 2015 06:31
浏览器检测
//https://github.com/hotoo/detector/blob/master/detector.js
var detector = {};
var NA_VERSION = "-1";
var win = this;
var external;
var re_msie = /\b(?:msie |ie |trident\/[0-9].*rv[ :])([0-9.]+)/;
var re_blackberry_10 = /\bbb10\b.+?\bversion\/([\d.]+)/;
var re_blackberry_6_7 = /\bblackberry\b.+\bversion\/([\d.]+)/;
var re_blackberry_4_5 = /\bblackberry\d+\/([\d.]+)/;