2014-02-05 115 views
0

我使用窗口小部件工厂为我的网站创建基本的jQuery幻灯片。在窗口小部件中获取调用自定义窗口小部件的对象

$('#front-page-slideshow .slides-container').slideShow({}); 

一旦小部件已经启动,我怎么能得到启动它的选择器?谢谢。

$.widget('DDUI.slideShow', { 

    options : { 

     automatic:  true, // Whether or not the slideShow is automatic 
     speed:   '3000' // The transition speed of the slides 

    }, // options 

    /** 
    * Constructor 
    */ 
    _create : function(){ 

     var caller = ??? 
     // 'caller' should be either string '#front-page-slideshow .slides-container' 
     // or object '$('#front-page-slideshow .slides-container')' 

    } // _create 

}); 

回答

1

对包含DOM元素的jQuery对象的引用可作为this.element的实例属性。

由于_create方法文档中解释说:

没有参数,但this.element和this.options已设置。

+0

宾果,谢谢。 –