(function($) {      // closure
    $.fn.hilight = function( options ) {  //将方法定义在$的fn上
        var defaults = {
            textColor: "#000",
            backgroundColor: "#fff"
        };
        var settings = $.extend( {}, defaults, options );
        return this.each(function() {
            // Plugin code would go here...
        });
    };
})(jQuery);

 使用

$(elem).hilight(options)
//或者
$.fn.hilight.call($(elem),options)

 

相关文章:

  • 2022-12-23
  • 2021-12-26
  • 2018-05-17
  • 2022-02-07
  • 2022-12-23
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-04
  • 2022-01-28
  • 2021-05-08
  • 2021-10-06
相关资源
相似解决方案