获取在窗口小部件中调用自定义窗口小部件的对象

时间:2014-02-05 10:38:20

标签: jquery jquery-ui-widget-factory

我正在使用Widget Factory为我的网站创建一个基本的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 个答案:

答案 0 :(得分:1)

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

_create方法文档中所述:

  

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

相关问题