Feature Discovery
Materialize is a modern responsive CSS framework based on Material Design by Google.
Open tap target
Close tap target
I am here
Provide value and encourage return visits by introducing users to new features and functionality at contextually relevant moments.
Copied!
content_copy
menu
Title
A bunch of text
Initialization
Copied!
content_copy
document.addEventListener('DOMContentLoaded', function() {
var elems = document.querySelectorAll('.tap-target');
var instances = M.TapTarget.init(elems, {
// specify options here
});
});
Options
Name | Type | Default | Description |
---|---|---|---|
onOpen | Function | null | Callback function called when Tap Target is opened. |
onClose | Function | null | Callback function called when Tap Target is closed. |
Methods
All the methods are called on the plugin instance. You can get the plugin instance like this:
Copied! content_copyvar instance = M.TapTarget.getInstance(elem);
.open();
Open Tap Target
instance.next();
instance.next(3); // Move next n times.
.close();
Close Tap Target
instance.close();
.destroy();
Destroy plugin instance and teardown
instance.destroy();
Properties
Name | Type | Description |
---|---|---|
el | Element | The DOM element the plugin was initialized with. |
options | Object | The options the instance was initialized with. |
isOpen | Boolean | If the tap target is open. |