docs/vendor/mixitup/mixitup.js
function() {
            var self = this,
                args = self.parseInsertArgs(arguments);

            return self.multimix({
                insert: args.command
            }, args.animate, args.callback);
        }
function() {
            var self = this,
                args = self.parseInsertArgs(arguments);

            return self.multimix({
                insert: args.command
            }, args.animate, args.callback);
        }
function ( ) { var self = this , args = self . parseInsertArgs ( arguments ) ; return self . multimix ( { insert : args . command } , args . animate , args . callback ) ; }
Inserts one or more new target elements into the container at a specified
index.

To be indexed as targets, new elements must match the `selectors.target`
selector (`'.mix'` by default).

@example

.insert(newElements [, index] [, animate], [, callback])

@example <caption>Example 1: Inserting a single element via reference</caption>

console.log(mixer.getState().totalShow); // 0

// Create a new element

var newElement = document.createElement('div');
newElement.classList.add('mix');

mixer.insert(newElement)
.then(function(state) {
console.log(state.totalShow === 1); // true
});

@example <caption>Example 2: Inserting a single element via HTML string</caption>

console.log(mixer.getState().totalShow); // 1

// Create a new element via reference

var newElementHtml = '&lt;div class="mix"&gt;&lt;/div&gt;';

// Create and insert the new element at index 1

mixer.insert(newElementHtml, 1)
.then(function(state) {
console.log(state.totalShow === 2); // true
console.log(state.show[1].outerHTML === newElementHtml); // true
});

@example <caption>Example 3: Inserting multiple elements via reference</caption>

console.log(mixer.getState().totalShow); // 2

// Create an array of new elements to insert.

var newElement1 = document.createElement('div');
var newElement2 = document.createElement('div');

newElement1.classList.add('mix');
newElement2.classList.add('mix');

var newElementsCollection = [newElement1, newElement2];

// Insert the new elements starting at index 1

mixer.insert(newElementsCollection, 1)
.then(function(state) {
console.log(state.totalShow === 4); // true
console.log(state.show[1] === newElement1); // true
console.log(state.show[2] === newElement2); // true
});

@example <caption>Example 4: Inserting a jQuery collection object containing one or more elements</caption>

console.log(mixer.getState().totalShow); // 4

var $newElement = $('&lt;div class="mix"&gt;&lt;/div&gt;');

// Insert the new elements starting at index 3

mixer.insert(newElementsCollection, 3)
.then(function(state) {
console.log(state.totalShow === 5); // true
console.log(state.show[3] === $newElement[0]); // true
});

@public
@instance
@since       2.0.0
@param       {(HTMLElement|Array.<HTMLElement>|string)}    newElements
A reference to a single element to insert, an array-like collection of elements, or an HTML string representing a single element.
@param       {number}    index=0
The index at which to insert the new element(s). `0` by default.
@param       {boolean}   [animate=true]
An optional boolean dictating whether the operation should animate, or occur syncronously with no animation. `true` by default.
@param       {function}  [callback=null]
An optional callback function to be invoked after the operation has completed.
@return      {Promise.<mixitup.State>}
A promise resolving with the current state object.
Inserts one or more new target elements into the container at a specified index .