Skip to content

Instantly share code, notes, and snippets.

View kejun's full-sized avatar
💭
I may be slow to respond.

kejun kejun

💭
I may be slow to respond.
View GitHub Profile
@kejun
kejun / RepeatFM
Created January 20, 2012 06:48
FM单曲循环(纯属个人瞎玩, 要求Firefox4+)
// ==UserScript==
// @name RepeatFM
// @namespace org.kejun
// @description FM单曲循环(纯属个人瞎玩, 要求Firefox4+)
// @include http://douban.fm, http://douban.fm/*
// ==/UserScript==
var isRepeat = localStorage.getItem('is_repeat_fm')|0;
function importCSS(str) {
@kejun
kejun / dabblet.css
Created February 23, 2012 06:43
通用按钮样式
/* 通用按钮样式 */
/* reset */
.bn-small,
a.bn-cta,
.bn-cta input,
.bn-flat input { margin:0;border:none;background:transparent;cursor:pointer;-webkit-appearance: none; }
.lnk-flat,
@kejun
kejun / dabblet.css
Created May 17, 2012 04:26
Untitled
@import url(http://img3.douban.com/css/core/packed__init_1507990223.css);
body { padding:20px; }
.sample-1 { color:#396; }
/*-----------------------------------*/
.loading i {
position: relative;
margin-right: 2px;
line-height: .5ex;
@kejun
kejun / dabblet.css
Created June 4, 2012 03:25
Untitled
.item {
margin-bottom: 20px;
padding: 10px;
font-size: 0;
border: 1px solid #efefef;
}
.item .pic ,
.item .content {
display: table-cell;
*display: inline;
@kejun
kejun / gist:3358036
Created August 15, 2012 09:23
ios/android兼容mouse事件
;(function($){
$.support.touch = 'ontouchend' in document;
if (!$.support.touch) {
return;
}
var eventMap = {
click: 'touchend',
mousedown: 'touchstart',
@kejun
kejun / gist:3936440
Created October 23, 2012 03:13
dom属性改变事件
;(function($) {
var MutationObserver = window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver;
function isDOMAttrModifiedSupported() {
var p = document.createElement('p');
var flag = false;
if (p.addEventListener) p.addEventListener('DOMAttrModified', function() {
flag = true
}, false);
@kejun
kejun / dabblet.css
Last active January 4, 2018 09:43
sample-1缺点 + 必须固定高度
body {
width: 600px;
font:normal 14px/1.62 arial, sans-serif;
}
.mod {
margin-bottom:100px;
background-color:#efc;
}
.pic {
margin-right: 20px;
@kejun
kejun / dabblet.css
Created December 5, 2012 05:07
Untitled
body { padding:1em;font:normal 14px/1.5 arial,sans-serif; }
.mod ul, .mod li { margin:0;padding:0;list-style:none; }
.mod li { padding:1ex 0;border-top: 1px solid #ccc; }
.mod li:nth-child(1) { border:none; }
.mod { width:40%;margin:auto;padding:1.5em;border:1px solid #eee; }
.mod li a { display:block;padding:10px;text-decoration:none; }
.mod li a:hover { color:#fff;background:#369;border-radius:5px;padding:10px 20px;margin-left:-20px;-webkit-transform:translate(10px,0) scale(1) translateZ(0); }
@kejun
kejun / dabblet.css
Created December 5, 2012 06:28
1tao笔试题
/* 1tao笔试题 */
.mod ul, .mod li { padding:0;margin:0;list-style:none; }
.mod {
width:165px;
padding:5px 0 0 5px;
overflow:hidden;
font-size:0;
letter-spacing:-0.31em;
*letter-spacing:normal;
word-spacing:-0.43em;
@kejun
kejun / dabblet.css
Created December 7, 2012 02:17
Untitled
.mod {
position: absolute;
width: 300px;
background: #eee;
border: 1px solid #eee;
padding: 0 50px;
-webkit-box-shadow: 0 0 4px 0 rgba(0,0,0,0.2);
-moz-box-shadow: 0 0 4px 0 rgba(0,0,0,0.2);
box-shadow: 0 0 4px 0 rgba(0,0,0,0.2);
top: 50%;