随笔分类 -  jQuery

摘要:解决方法 阅读全文
posted @ 2018-12-24 16:03 wisdomns 阅读(1438) 评论(0) 推荐(0)
摘要:Source 阅读全文
posted @ 2018-10-11 22:13 wisdomns 阅读(419) 评论(0) 推荐(0)
摘要:$(this)属于jQuery,this属于js。 举个栗子先, alert($(this)); 弹出的结果是[object Object ] alert(this); 弹出来的是[object HTMLImageElement] $("#desktop a img")就是上文所指的$(this), 阅读全文
posted @ 2018-06-19 14:57 wisdomns 阅读(243) 评论(0) 推荐(0)
摘要:this.each()执行完返回的是this,这时候再return this.each(),返回的依旧是this,而这个this上下文又是指代$(‘[title]‘),意味着你可以在colorTip()后继续加其他方法,比如: 阅读全文
posted @ 2018-06-15 22:35 wisdomns 阅读(596) 评论(0) 推荐(0)
摘要:$ $ 是JQuery的别称,可以代替JQuery,定义为 "选取" fn 资源来源 先看两个例子: 两个例子区别在于$.后有无fn,jQuery为开发插件提拱了两个方法,分别是: 我们来看看fn的定义 jQuery.fn.extend(object);是对jQuery.prototype进得扩展, 阅读全文
posted @ 2018-06-13 16:01 wisdomns 阅读(198) 评论(0) 推荐(0)
摘要:资料来源 (function($){...})(jQuery)实际上是匿名函数function(arg){...}的变形。 function(arg){...} 定义了一个匿名函数,参数为arg,实参写在函数后面的{...}中,由于操作符的优先级,函数本身也需要用括号,即(function(arg) 阅读全文
posted @ 2018-06-13 10:41 wisdomns 阅读(188) 评论(0) 推荐(0)