06 2010 档案
JS拖拽函数
摘要:function begin(drag){ var x=event.clientX-parseInt(drag.style.left); var y=event.clientY-parseInt(drag.style.top); document.attachEvent("onmousemove",move); document.attachEvent("onmouseup",getup) fun... 阅读全文
posted @ 2010-06-30 10:48 刘卿 阅读(208) 评论(0) 推荐(0)
JS 日期操作
摘要:var now = new Date(); //当前日期 var nowDayOfWeek = now.getDay(); //今天本周的第几天 var nowDay = now.getDate(); //当前日 var nowMonth = now.getMonth(); //当前月 var nowYear = now.getYear(); //当前年 nowYear += (nowYear &... 阅读全文
posted @ 2010-06-30 10:16 刘卿 阅读(349) 评论(0) 推荐(0)
IE6 IE7 createElement的问题
摘要:在IE6 IE7 下给父页面添加元素,你必须给父页面创建该元素, parent.document.createElement(‘div’); 在FF IE8中,允许在子页面创建父页面的元素。所以在FF IE8中可以使用 parent.document.createElement(‘div’); 或者 document.createElement(‘div’) 总结: 使用 parent.doc... 阅读全文
posted @ 2010-06-28 09:52 刘卿 阅读(442) 评论(0) 推荐(0)
border属性性能最优
摘要:今天看了小志的,border属性的性能测试,才知道浏览器渲染时,border:none;或者border:0,差与border:0 none; 阅读全文
posted @ 2010-06-18 17:00 刘卿 阅读(243) 评论(0) 推荐(0)
jquery中each中的break何continue
摘要:在一个function里有一个each,在each里某种条件 成立的话,就把这个function返回true或者falsefunction methodone(){....$.each(array,function(){if(条件成立){return true;}});....}如果发现老是不对。后来查找资料才发现,在each代码块内不能使用break和continue,要实现break和cont... 阅读全文
posted @ 2010-06-10 10:05 刘卿 阅读(410) 评论(0) 推荐(0)