intro.js
/**
      * Initiate a new introduction/guide from an element in the page
      *
      * @api private
      * @method _introForElement
      * @returns {Boolean} Success or not
      */
Initiate a new introduction/guide from an element in the page
@api private
@method _introForElement
@returns {Boolean} Success or not
Initiate a new introduction / guide from an element in the page @api private @method _introForElement @returns { Boolean } Success or not
function _introForElement() {
        var introItems = [];
        var i, steps, step, getStepDataFn;
        if (this._options.steps) {
            steps = this._options.steps;
            getStepDataFn = _getStepDataFromObject.bind(this);
        } else {
            steps = this._rootElement.querySelectorAll(this._options.stepIdentifier + '[data-intro-step]');
            getStepDataFn = _getStepDataFromElement.bind(this);
        }
        if (steps.length === 0) {
            return false;
        }
        for (i = 0; i < steps.length; i++) {
            step = getStepDataFn(steps[i]);
            introItems.push(step);
        }
        introItems.sort(function(a, b) {
            return a.step - b.step;
        });
        this._introItems = introItems;
        _nextStep.call(this);
        this._onKeyDown = _onKeyDown.bind(this);
        window.addEventListener('keydown', this._onKeyDown, true);
        return false;
    }
function _introForElement ( ) { var introItems = [ ] ; var i , steps , step , getStepDataFn ; if ( this . _options . steps ) { steps = this . _options . steps ; getStepDataFn = _getStepDataFromObject . bind ( this ) ; } else { steps = this . _rootElement . querySelectorAll ( this . _options . stepIdentifier + '[data-intro-step]' ) ; getStepDataFn = _getStepDataFromElement . bind ( this ) ; } if ( steps . length === 0 ) { return false ; } for ( i = 0 ; i < steps . length ; i ++ ) { step = getStepDataFn ( steps [ i ] ) ; introItems . push ( step ) ; } introItems . sort ( function ( a , b ) { return a . step - b . step ; } ) ; this . _introItems = introItems ; _nextStep . call ( this ) ; this . _onKeyDown = _onKeyDown . bind ( this ) ; window . addEventListener ( 'keydown' , this . _onKeyDown , true ) ; return false ; }
Initiate a new introduction/guide from an element in the page
 @api private
 @method _introForElement
 @returns {Boolean} Success or not
Initiate a new introduction / guide from an element in the page @api private @method _introForElement @returns { Boolean } Success or not
// use steps passed programmatically // use steps from data-* annotations // Ok, sort all items with given steps // set it to the introJs object // then, start the show // Save a bound version of the function so we can call removeEventListener on it later