Foonation Foonation - 4 years ago 90
Javascript Question

How to convert functional bootstrap JS into Accelerated Mobile Project (AMP)

Recently, I'm converting all external Javascript into amp mode. I used amp-iframe to visit the javascript website and amp-form to submit my form. Image tags changed to amp-img tag. But when comes to my navbar collapse burger button in mobile responsive or jquery animation slide down when user clicks one of the menu link, both doesn't work. Because I already remove all the external Javascripts in my website. Only amp javascript is allowed this case.


  1. How can I make the burger navbar collapse button works again?

  2. How can I perform animation slide down when user clicks menu link?

  3. Any AMP tags or tricks can do such this thing ?



AMP Documentation: https://www.ampproject.org/docs/get_started/create

Answer Source

The side-bar as mentioned by @Lovntola is just one of the many components that AMP HTML supports. However, don't expect that each functionality in bootstrap has a similar feature in AMP HTML.

Accelerated Mobile Pages are just like any other HTML page, but with a limited set of allowed technical functionality that is defined and governed by the open source AMP spec. Just like all web pages, Accelerated Mobile Pages will load in any modern browser or app webview.

If the feature you're not looking is not in the list of components, it may not be supported yet. You may want to contribute to AMP HTML.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download