$.fn是指jquery的命名空间,加上fn上的方法及属性,会对jquery实例每一个有效。 
如扩展$.fn.abc() 
那么你可以这样子:$("#div").abc(); 
通常使用$.extend()方法扩展.


$.fn是什么东西呢。查看jQuery代码,就不难发现。

jQuery.fn = jQuery.prototype = {

   init: function( selector, context ) {//.... 

};

原来 jQuery.fn = jQuery.prototype.对prototype肯定不会陌生啦。

 

来源:https://blog.csdn.net/z69183787/article/details/18802087

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2021-05-07
  • 2021-12-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-06-05
  • 2021-12-16
  • 2021-08-31
相关资源
相似解决方案