Skip to content

Instantly share code, notes, and snippets.

@ikitty
ikitty / xib.js
Last active October 30, 2015 08:32
Javascript common functions
// all I did javascript common functions
var strHTML += '\
<li>\
<p class="mo_name">' + kk.name + '</p>\
</li>\
';
/**
* simple Tab by alex
*
@ikitty
ikitty / detectBrowser.js
Created November 23, 2014 12:19
detectBrowser
var Sys = {};
var ua = navigator.userAgent.toLowerCase();
var s;
(s = ua.match(/msie ([\d.]+)/)) ? Sys.ie = s[1] :
(s = ua.match(/firefox\/([\d.]+)/)) ? Sys.firefox = s[1] :
(s = ua.match(/chrome\/([\d.]+)/)) ? Sys.chrome = s[1] :
(s = ua.match(/opera.([\d.]+)/)) ? Sys.opera = s[1] :
(s = ua.match(/version\/([\d.]+).*safari/)) ? Sys.safari = s[1] : 0;
//以下进行测试
<!DOCTYPE html>
<html>
<head>
<meta charset="gbk">
<style>
body,h1,h2,h3,h4,p,ul,ol,li{margin:0;padding:0;}
li{list-style:none;}
img{border:0;}
var _st ;
function lazyRun (fn, time) {
time = time || 80;
if (_st) {
clearTimeout(_st);
}
_st = setTimeout(function () {
fn();
}, time);
}
@ikitty
ikitty / videoCover.css
Created October 16, 2014 04:07
video simulate cover effect
video {display:block;min-width: 100%;min-height: 100%;width:auto;height:auto;}
<style>
* {margin:0;padding:0;list-style:none;}
.Enix_tab_hd {width:300px;height:30px;_overflow:hidden;margin:20px 0px 0px 20px;border-bottom:1px solid #999;}
.Enix_tab_hd a {float:left;height:29px;line-height:29px;padding:0px 10px;margin-left:10px;border:1px solid #999;border-bottom:0;background-color:#ccc;}
.Enix_tab_hd a.on {_position:relative;height:30px;background-color:#fff;}
.Enix_tab_bd {clear:both;margin-top:10px;margin-left:20px;width:300px;}
</style>