October 2017
Intermediate to advanced
370 pages
8h 57m
English
We can use any element to trigger the sidebar menu, such as a hamburger menu image, or a plain old button. Let's start with a simple HTML button, and we can spruce it up as we go.
Add the following markup to the page after the closing </amp-sidebar> tag:
<button on="tap:sidenav.open">Menu</button>

This gives us a button that we can click to open the sidebar menu. Mission accomplished? Not quite! It looks pretty awful: it's unstyled, and the button is poorly positioned, pushing the rest of the page ...
Read now
Unlock full access