Skip to content

Instantly share code, notes, and snippets.

View libo1106's full-sized avatar

libo libo1106

View GitHub Profile
@libo1106
libo1106 / button_onclick
Created July 5, 2012 15:06
button.onclick事件汇总
<html>
<input onclick="document.all.WebBrowser.ExecWB(1,1)" type="button" value="打开" name="Button1">
<input onclick="document.all.WebBrowser.ExecWB(4,1)" type="button" value="另存为" name="Button2">
<input onclick="document.all.WebBrowser.ExecWB(10,1)" type="button" value="属性" name="Button3">
<input onclick="document.all.WebBrowser.ExecWB(6,1)" type="button" value="打印" name="Button">
<input onclick="document.all.WebBrowser.ExecWB(8,1)" type="button" value="页面设置" name="Button4">
@libo1106
libo1106 / gist:3174103
Created July 25, 2012 02:50
check iframe is onloaded
var iframe = document.createElement("iframe");
iframe.src = "http://www.planabc.net";
if (iframe.attachEvent){
iframe.attachEvent("onload", function(){
alert("Local iframe is now loaded.");
});
} else {
iframe.onload = function(){
alert("Local iframe is now loaded.");
@libo1106
libo1106 / clickpost()
Created August 24, 2012 06:02
javascript获取url中的GET参数,并且重新发一个新的xml请求
function clickpost(){
var tracking = 'http://www.demo.com/tracking?type=click&';
var adurl = window.location.href.split("?");
var parameters = adurl[1];
var xmlhttp;
if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp = new XMLHttpRequest();
xmlhttp.open('GET', tracking + parameters, true);
xmlhttp.send();
@libo1106
libo1106 / mobile-meta-links.html
Created September 10, 2012 08:18
iOS Web App Configuration
@libo1106
libo1106 / goagent.sh
Created September 19, 2012 05:46
goagent.sh
#!/bin/sh
nohup python ~/goagent/local/proxy.py >/dev/null 2>&1 &
@libo1106
libo1106 / source.js
Created November 26, 2012 05:05
iframe子页面动态改变父页面iframe高度
//调整iframe高度
var height = $(document).height() + 'px';
var iframe = parent.document.getElementById('main');
iframe.style.height = height;
@libo1106
libo1106 / tips-for-css.css
Created December 4, 2012 09:08
tips存CSS实现,支持IE7+、Chrome、Firefox、Opera
a .tips_hover {
color:#333;
line-height:18px;
vertical-align:middle;
text-shadow:#ffffff 0 1px 0;
text-align: left;
padding:7px 14px;
width: 300px;
position: relative;
top: -999px;
@libo1106
libo1106 / inline-block.css
Last active October 13, 2015 22:28
跨浏览器兼容inline-block
ul{
font-size:*0;/*修复各个浏览器对于inline-block存在默认横向间距,除IE8*/
}
ul li{
display: inline-block;
*zoom:1;
*display:inline;
font-size: 12px;/*使用正常字号*/
font-family: "宋体"; /*中英混排基线对齐*/
margin-right: -.6em; /* 12px字体时候消除间隔*/
@libo1106
libo1106 / z-index.txt
Created December 16, 2012 08:07
z-index规则
全局导航框架类型的z-index默认设置为2
z-index:1这层留给兼容IE的父元素使用
@libo1106
libo1106 / margin.html
Created December 16, 2012 08:40
margin合并处理
<head>
<style>
div{ padding: 0 20px; overflow: hidden; zoom :1;}
div p{ margin: 10px 0;}
</style>
</head>
<div>
<p>第一段</p>
<p>第二段</p>
<div>