Skip to content

Instantly share code, notes, and snippets.

View sofish's full-sized avatar
🎯
Focusing

小鱼 sofish

🎯
Focusing
View GitHub Profile
<!doctype html>
<html>
<head>
<meta charset="gb2312">
<title>IE z-index bug</title>
<style type="text/css">
#t{position:relative;height: 300px;}
#yellow{position:relative;}
#yellow p, #green{width:200px;height:200px;background-color:#9c0;;}
#yellow p{position:absolute;background-color:#FF0;z-index:10000000000;}
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>tab</title>
<style type="text/css">
.tab-content{clear:both;width:360px;}
.tab-content div{border:1px solid #ddd;padding:20px;}
.tab-title li{padding:5px 10px;margin-right:5px;float:left;list-style:none;background:#eee;}
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Sample</title>
<style type="text/css">
#text li{color:#f30;}
#text li span{color:#080;}
</style>
</head>
@sofish
sofish / wh.js
Created November 15, 2010 13:00
function getWH(){
var pageWidth = window.innerWidth,pageHeight = window.innerHeight;
if(typeof pageWidth != "number"){
if(document.compatMode == "CSS1Compat"){
pageWidth = document.documentElement.clientWidth;
pageHeight = document.documentElement.clientHeight;
}else{
pageWidth = document.body.clientWidth;
pageHeight = document.body.clientHeight;
AP.widget.tipdone = new AP.Class(
/**
*@lends AP.widget.tipdone.prototype
*@author xuning
*/
{
/**
*设置属性
*@returns {Object}
*/
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Sample</title>
<style type="text/css">
.preview{width:600px;padding:20px 25px;font:12px/1.5 Courier, "Courier New", Arial, sans-serif;border:3px solid #ddd;background:#f7f7f7;white-space:pre-wrap;ord-wrap:break-word;word-break:break-all;*zoom:1;}
.preview h3{font:500 16px 'Microsoft Yahei';margin:0;color:#c30;}
</style>
</head>
<h1>HTML5: Audio &amp; Video API</h1>
<ol><li><a href="#spec-browser">浏览器支持</a></li>
<li><a href="#spec-api">规范 API</a></li>
<li><a href="#spec-demo">DEMO</a></li>
<li><a href="#spec-caution">注意事项</a></li>
<li><a href="#spec-solution">兼容解决方案</a></li>
<li><a href="#spec-ref">参考文献</a></li>
</ol>
<h2 id="spec-browser">一、浏览器支持</h2>
<h2 id="spec-api">二、API 参考</h2>
@sofish
sofish / gist:781901
Created January 16, 2011 15:56
input:blur
var input = document.getElementsByTagName('input'), length = input.length, i = 0;
for(;i<length;){
input[i++].onblur = function(){
alert('yeah');
}
}
@sofish
sofish / gist:794702
Created January 25, 2011 09:21
inline.html
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Sample</title>
<style>
*{margin:0;padding:0;}
html{-webkit-text-size-adjust:none;}
#test{font:0 tahoma;list-style:none;display:block;text-align:center;}
@media screen and (-webkit-min-device-pixel-ratio:0){ #test{font-size:1px;} }
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Sample</title>
<style>
.cnt{text-align:center;width:600px;height:300px;margin:0 auto;border:1px solid #ddd;}
</style>
</head>
<body>