Skip to content

Instantly share code, notes, and snippets.

@axdemelas
Last active June 12, 2016 09:17
Show Gist options
  • Save axdemelas/f3489660ccea7cf0b225 to your computer and use it in GitHub Desktop.
Save axdemelas/f3489660ccea7cf0b225 to your computer and use it in GitHub Desktop.
Basic usage of stepper
// Select your stepper element.
var stepperElement = document.querySelector('ul.mdl-stepper');
var Stepper;
// Check if MDL Component Handler is loaded.
if (typeof componentHandler !== 'undefined') {
// Get the MaterialStepper instance of element to control it.
Stepper = stepperElement.MaterialStepper;
// Moves the stepper to the next step for test.
Stepper.next();
} else {
// Material Design Lite javascript is not loaded or for another
// reason MDL Component Handler is not available globally and
// you can't use (register and upgrade) Stepper component at this point.
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment