摘要:
/* * 考虑到getAttribute(),在IE6,7下对class有兼容性问题所以使用getAttributeNode(); * removeNamedItem(),在IE6,7下动态添加属性后,表现异常.所以使用removeAttribute(); */<div title="hello" id="main" dir="rtl" mytitle="whoat">my!</div><script type="text/javascript">var at 阅读全文
摘要:
/* * IE6,7,8使用onpropertychange就能实现自适应; * FF,Chrom,opera,让textarea恢复原高度让他获取ScrollHeight的正确高度; * IE9,退格键oninput,onpropertychange都触发不了回调函数,所以绑定个onkeyup; */<style type="text/css">.box{padding-top:50px;text-align:center;margin-bottom:20px;}.main{width:200px;height:48px;border:1px solid #C 阅读全文
摘要:
/* * PS:旋转层的背景是必须的,不然IE8以下使用滤镜旋转会让字体变模糊,效果不太好. */<style type="text/css">.box{position:relative;width:20px;height:200px;background:#CCC;margin:50px;overflow:hidden;}.main{position:absolute;width:100px;height:100px;line-height:100px;top:10px;left:50%;margin-left:-50px;color:#FFF;text-a 阅读全文
摘要:
var loadhandler = function(fun){ if(typeof fun !== "function") return false; if(!!window.onload){ var oldfun = window.onload; window.onload = function(){ oldfun(); fun(); } }else{ window.onload = fun; } }var inputhandler = ... 阅读全文
摘要:
/* * DOM的继承, JQ是用一个工厂函数,Prototype是用原型链,但是在IE67只能静态的生成方法. * 两者合二为一为怎样呢? 一下就是我们的实现, IE7以上用原型继承Element,IE7和IE6,用构造函数,为了随时能切换在方法中写了dom()方法来获取DOM元素方便切换. */<div class="main1" id="main">111a</div><div class="main2">222b</div><script type="text/j 阅读全文
摘要:
<img id="img1" mysrc="http://pic002.cnblogs.com/images/2012/319713/2012103021492628.jpg" width="200" height="248" src="img/tran.gif" style="background:url(img/loading.gif) no-repeat center #CCC;" /><img id="img2" mysrc=&q 阅读全文
摘要:
function main(){ var str = new Array(1000).join(new Array(5000).join("xxxxx")); return function(){ var arr = []; arr.push(str); } } //这里内存无异常 用sIEve 显示为 19000+var other = main(); //这里内存开始一场 显示为 68000+other = null; //这里内存还原 显示为19000+(function(){ v... 阅读全文
摘要:
var time = null;$("#menu").hover(function(){ clearTimeout(time); $("#show").show(); console.log("show"); },function(){ time = setTimeout(function(){ $("#show").hide(); console.log("hide"); },50); });$("#show").hover(function(){ clearTimeout 阅读全文
摘要:
/*----css----*/<style type="text/css">.shao-add{height:672px;background:url(http://zunjueclub.com/img/bg/add_bg00.jpg) no-repeat center top;}.shao-add-bg{background:url(img/bg/add_bg01.gif) repeat-x 0 0;position:relative;height:0;overflow:hidden;}.shao-close{position:absolute;bottom: 阅读全文
摘要:
<script type="text/javascript">function wHeight(){ var height = null; window.innerHeight ? height = window.innerHeight : height = document.documentElement.clientHeight; return height; }var bodyheight = wHeight();var x = 50,y = 60var xin = true, yin = truevar step = 1 var delay = 20va 阅读全文