随笔分类 -  JQuery

摘要:Function.prototype.method = function(name, func) { this.prototype[name] = func; return this; };String.method('trim', function() { return this.replace(/^\s+|\s+$/g, ''); }); 阅读全文
posted @ 2012-01-30 13:27 柠檬Cool 阅读(281) 评论(0) 推荐(0)
摘要:页面加载完成后开始运行do stuff when DOM is ready 中的语句! $(document).ready(function() { // do stuff when DOM is ready }); 选择器 $(“a”)是一个jquery的选择器(selector) $("")其中的字段就是元素的标记。比如$("div")就是<div></div> click是函数对象的一个方法。方法为点击鼠标事件! 例: $(document).ready(function() { $("a").click 阅读全文
posted @ 2012-01-06 09:58 柠檬Cool 阅读(61368) 评论(0) 推荐(7)