October 2017
Intermediate to advanced
370 pages
8h 57m
English
We mentioned earlier that a tap listener can be applied to any HTML or AMP-HTML element. Equally, there are some actions that can be applied to any element. These are hide, show, and toggleVisibility. Thus, you could build a basic modal dialog with something like this:
<div id="confirm">Are you sure you want to continue?</div><a on="tap:confirm.hide">Cancel</a> <a href="confirm-page.html">Confirm</a>
Or you could toggle a settings panel with code like this:
<div id="settings">Your account settings...</div><button on="tap:settings.toggleVisibility">Settings</button>
Read now
Unlock full access