1. 通过$.extend()来扩展jQuery;

$.extend({
  sayHello:function(){
      console.log("Hello");
   }
})
$.sayHello();

2. 通过$.fn 向jQuery添加新的方法;

$.fn.blue = function(){
   this.css('background-color','blue');
}
$("div").blue();
$("body").blue();

 

3. 通过$.widget()应用jQuery UI的部件工厂方式创建。

相关文章:

  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-03-30
  • 2021-04-16
  • 2021-04-10
  • 2021-10-02
猜你喜欢
  • 2021-09-13
  • 2022-12-23
  • 2021-11-18
  • 2022-01-08
  • 2022-01-18
相关资源
相似解决方案