mixitup.md

November 30, 2016 ยท View on GitHub

#mixitup()

Version added: 3.0.0

mixitup(container [,config] [,foreignDoc])

The mixitup() "factory" function creates and returns individual instances of MixItUp, known as "mixers", on which API methods can be called.

When loading MixItUp via a script tag, the factory function is accessed via the global variable mixitup. When using a module loading system (e.g. ES2015, CommonJS, RequireJS), the factory function is exported into your module when you require the MixItUp library.

TypeNameDescription
ParamElement, stringcontainerA DOM element or selector string representing the container(s) on which to instantiate MixItUp.
Paramobject[config]An optional "configuration object" used to customize the behavior of the MixItUp instance.
Paramobject[foreignDoc]An optional reference to a document, which can be used to control a MixItUp instance in an iframe.
Returnsmixitup.MixerA "mixer" object holding the MixItUp instance.
Example 1: Creating a mixer instance with an element reference
var containerEl = document.querySelector('.container');

var mixer = mixitup(containerEl);
Example 2: Creating a mixer instance with a selector string
var mixer = mixitup('.container');
Example 3: Passing a configuration object
var mixer = mixitup(containerEl, {
    animation: {
        effects: 'fade scale(0.5)'
    }
});
Example 4: Passing an iframe reference
var mixer = mixitup(containerEl, config, foreignDocument);