摘要: // 封装一个方法能够在元素后面插入dom元素 (在原型链上编程) <div> <span></span> <p></p> <strong></strong> <i></i> <address></address> </div> Element.prototype.insertAfter=funct 阅读全文
posted @ 2020-08-08 09:53 菜鸟程序员的总结 阅读(253) 评论(0) 推荐(0)
摘要: function getStyle(ele,prop){ if(window.getComputedStyle){ //w3c标准 return window.getComputedStyle(ele,null)[prop]; }else{//ie低版本 return ele.currentStyl 阅读全文
posted @ 2020-08-08 09:27 菜鸟程序员的总结 阅读(286) 评论(0) 推荐(0)
摘要: 对给定的内容进行小驼峰式转换 var reg=/-(\w)/g; var str="the-first-name"; str=str.replace(reg,function($,$1){ return $1.toUpperCase(); }) console.log(str) // theFirs 阅读全文
posted @ 2020-08-08 09:08 菜鸟程序员的总结 阅读(237) 评论(0) 推荐(0)