08 2011 档案

摘要:天天jQuery之 $.fn相信大家写过jQuery插件的童鞋都熟悉$.fn.plugin=function(){return this.each(function(){})}. 然后通过选择器得到jQuery Object掉用该方法$(elem).plugin().问题:plugin是扩展到$.f... 阅读全文
posted @ 2011-08-31 12:50 逆天寒 阅读(282) 评论(0) 推荐(0)
摘要:借用jQuery对浏览器的强用力的正则表达式判断,扩展下(function(){functionuaMatch(ua){ua=ua.toLowerCase();varmatch=/(webkit)[\/]([\w.]+)/.exec(ua)||/(opera)(?:.*version)?[\/]([\w.]+)/.exec(ua)||/(msie)([\w.]+)/.exec(ua)||!/compatible/.test(ua)&&/(mozilla)(?:.*?rv:([\w.]+))?/.exec(ua)||[];return{browser:match[1]||&quo 阅读全文
posted @ 2011-08-23 17:20 逆天寒 阅读(197) 评论(0) 推荐(0)
摘要:我们在往页面元素添加事件处理的时候,一般有如下二种方式:IE中 elm.attachEvent, FF系列elm.addEventLister直接绑定elm.onclick当我们往同一个元素多次注册事件处理函数时,顺序是很有意思的<html><head><title>Event注册</title></head><body><inputtype="button"id="bt"value="click"/></body><scriptty 阅读全文
posted @ 2011-08-23 17:09 逆天寒 阅读(585) 评论(0) 推荐(1)