Search code examples
javascripteventsdom-eventsamp-htmlamp-story

How do events and event objects work in amp-story? Is there a full list of AMP events and actions? Is there a full list for amp-story?


https://www.oreilly.com/library/view/amp-building-accelerated/9781786467317/d236e811-756a-4ffb-8f8b-712a34b8f751.xhtml

So far, the only event we've seen is tap, and the only actions we've seen are open, close, and dismiss. You might be curious about what others are available. While tap applies to all elements, most events in AMP are specific to particular elements. For example, forms have submit , submit-success, and submit-error events, and input elements have a change event , while amp-selector has a select event, to name a few. There are many more; for a full list of AMP events and actions, see Appendix B, Actions and Events.

Event Objects

When an event occur in HTML, the event belongs to a certain event object, like a mouse click event belongs to the MouseEvent object.

The Event Object

All event objects are based on the Event Object, and inherits all of it's properties and methods

common event objects

  • AnimationEvent For CSS animations
  • ClipboardEvent For modification of the clipboard
  • DragEvent For drag and drop interaction
  • FocusEvent For focus-related events
  • HashChangeEvent For changes in the anchor part of the URL
  • InputEvent For user input
  • KeyboardEvent For keyboard interaction
  • MouseEvent For mouse interaction
  • PageTransitionEvent For navigating to, and away from, web pages
  • PopStateEvent For changes in the history entry
  • ProgressEvent For the progress of loading external resources
  • StorageEvent For changes in the window's storage area.
  • TouchEvent For touch interaction
  • TransitionEvent For CSS transitions
  • UiEvent For user interface interaction
  • WheelEvent For mousewheel interaction

Solution

  • The full list for AMP generally can be found in the AMP Actions and Events documentation.

    For AMP stories, there are currently no events supported.