摘要: 1 var gys = function () { } 2 //oParent父节点 3 //获取所有的子元素 4 gys.prototype.getElementChildren = function (oParent) { 5 return oParent.children; 6 } 7 //arr获取的数组,jsonCss是修改属性css的json数据 8 // gys.setElementCss(aLi, {"color":"red","backgroundColor":"yellow","bac 阅读全文
posted @ 2014-03-03 17:55 思思博士 阅读(817) 评论(0) 推荐(1) 编辑
摘要: 这段代码是从javascript高级程序设计(第三版)上面事件部分抽取出来的,共享一下,级当时自己做个笔记.以后应该能够用得找. 1 var EventUtil = { 2 addHandler: function (element, type, handler) {//注册事件 3 if (element.addEventListener) {//非IE 4 element.addEventListener(type, handler, false); 5 } 6... 阅读全文
posted @ 2014-03-03 17:49 思思博士 阅读(684) 评论(0) 推荐(0) 编辑