2013-01-22 133 views
1

我想重写lightbox库的私有函数。是否可以扩展私人功能?

这是它的部分代码:

$.fn.lightBox = function(settings) { 

    var jQueryMatchedObj = this; // This, in this context, refer to jQuery object 

    function _set_interface() 
    { 
     //.... 
    } 

    function _start(objClicked,jQueryMatchedObj) { 
     //... 
     _set_interface(); 
     //... 
    } 

    function _initialize() { 
    _start(this,jQueryMatchedObj); 
     return false; 
    } 

    return this.unbind('click').click(_initialize); 
} 

我需要重写_set_interface功能。可能吗?

+3

不可能。这就是为什么他们被称为“私人” –

回答

4

不,这是不可能的....

你应该把插件的私人范围的访问权限。

哪个(@crush在下面的评论中说)是私有函数(或范围)的整个点。

+3

这是私人功能的全部点... – crush

+0

@crush确切! – Neal