Coachmark"
Line 22: | Line 22: | ||
= Supported Browsers = | = Supported Browsers = | ||
− | This component uses CSS keyframes. Browsers that support CSS keyframes (IE10+, Edge, Chrome, Firefox, Safari) are compatible with this feature. | + | This component uses CSS keyframes. Browsers that support CSS keyframes (IE10+, Edge, Chrome, Firefox, Safari) are compatible with this feature. Please check [https://caniuse.com/?search=%40keyframes browser compatibility]. |
=Open / Close the Coachmark= | =Open / Close the Coachmark= |
Revision as of 09:40, 20 September 2022
Coachmark
Since 9.0.0
- Available for ZK:
Employment/Purpose
Coachmark is used to attract users' attention to the target component and display a dialog. Once a coachmark is opened, the background mask will be displayed and the target component will be highlighted.The content of coachmark should be as relevant as possible to the context. You can use more than one coachmarks to guide users to perform a series of operations in the desired order.
Example
<button id="infoButton" label="Information" />
<coachmark target="infoButton" onTargetClick="self.close()">
<label>Wellcome! click here for more information!</label>
<button style="display: block;margin: 10px auto 0" label="got it!" onClick="self.parent.close()"/>
</coachmark>
Supported Browsers
This component uses CSS keyframes. Browsers that support CSS keyframes (IE10+, Edge, Chrome, Firefox, Safari) are compatible with this feature. Please check browser compatibility.
Open / Close the Coachmark
By default, a Coachmark opens itself after a page loading without user interaction. If you want to open a Coachmark in a specific timing, please set visible="false"
.
Both visible
attribute and open/close
methods allow you to open or close the Coachmark.
Properties
Target
The target component that the Coachmark will point itself to.
You need to specify a component's id or an EL expression that resolved to a component e.g. ${self.previousSibling}
<button id="infoButton" label="button"/>
<coachmark target="infoButton">
<label>Wellcome!</label>
</coachmark>
Position
The positions of a coachmark(default: after_center). Here are the available options:
start/before | center | end/after | |
---|---|---|---|
top | before_start | before_center | before_end |
bottom | after_start | after_center | after_end |
left | start_before | start_center | start_after |
right | end_before | end_center | end_after |
Next
The next Coachmar which will be opened when the onTargetClick event or the next() method is called. You need to specify a Coachmark's id or an EL expression that resolved to a Coachmark e.g. ${self.previousSibling}
Note: if you call next(Coachmark coachmark)
, it will open the specified coachmark instead of the predefined "next" coachmark.
Methods
public void next()
: Closes the current coachmark and opens the next one.
public void next(Coachmark coachmark)
: Close the current coachmark and opens the one you passed. (ignore the next coachmark you already set)
Supported Events
onOpen |
Event: OpenEvent
Denotes that the user has opened or closed a component. Note: unlike |
onTargetClick |
Event: MouseEvent
Represents an event caused by a user's click on a highlighted target component. |
- Inherited Supported Events: XulElement
Supported Children
*ALL
Version History
Version | Date | Content |
---|---|---|
9.0.0 | Nov, 2019 | ZK-4382: Provide a Coachmark component |