0

I'm creating a basic jQuery slideshow for my website using the Widget Factory.

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

Once the widget has been initiated, how can I get the selector that initiated it? Thanks.

$.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 Answer 1

1

A reference to a jQuery object containing the DOM element is available as a property of the instance as this.element.

As explained in the _create method documentation :

There are no parameters, but this.element and this.options are already set.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.