Feature Discovery
Materialize is a modern responsive CSS framework based on Material Design by Google.
Provide value and encourage return visits by introducing users to new features and functionality at contextually relevant moments.
Feature discovery prompts have more impact when they are presented to the right users at contextually relevant moments. When presented to the wrong user at the wrong time, they can be intrusive and annoying.
Open tap target Close tap targetI 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() {
const elems = document.querySelectorAll('.tap-target');
const 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_copyconst 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. |