2012年11月18日
摘要: /* * 考虑到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 阅读全文
posted @ 2012-11-18 22:42 somesayss 阅读(17315) 评论(0) 推荐(0) 编辑
  2012年11月17日
摘要: /* * 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 阅读全文
posted @ 2012-11-17 20:40 somesayss 阅读(4600) 评论(1) 推荐(0) 编辑
  2012年11月16日
摘要: /* * 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 阅读全文
posted @ 2012-11-16 10:08 somesayss 阅读(3260) 评论(0) 推荐(0) 编辑
  2012年11月13日
摘要: 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 = ... 阅读全文
posted @ 2012-11-13 21:20 somesayss 阅读(319) 评论(0) 推荐(0) 编辑
  2012年11月10日
摘要: /* * 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 阅读全文
posted @ 2012-11-10 22:40 somesayss 阅读(1311) 评论(0) 推荐(0) 编辑
  2012年10月31日
摘要: <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 阅读全文
posted @ 2012-10-31 23:11 somesayss 阅读(1355) 评论(0) 推荐(0) 编辑
  2012年10月29日
摘要: 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... 阅读全文
posted @ 2012-10-29 22:25 somesayss 阅读(3358) 评论(0) 推荐(0) 编辑
  2012年10月26日
摘要: 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 阅读全文
posted @ 2012-10-26 16:01 somesayss 阅读(7793) 评论(0) 推荐(2) 编辑
  2012年9月29日
摘要: /*----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: 阅读全文
posted @ 2012-09-29 10:43 somesayss 阅读(684) 评论(0) 推荐(0) 编辑
  2012年9月17日
摘要: <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 阅读全文
posted @ 2012-09-17 15:27 somesayss 阅读(713) 评论(0) 推荐(0) 编辑