JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q17427F
  • License MIT

A simple image hotspot library using popover API.

Package Exports

  • easy-image-hotspot
  • easy-image-hotspot/dist/image-hotspot.es.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (easy-image-hotspot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Under construction... PRs are welcome!

Image Hotspot

This small library is perfect for handling popovers. It uses the latest popover API

How to use it

  • Create a new container:
    • let container = createContainer();
  • Add a background image:
    • container.addImage("/world-map.svg", "world map");
  • Add as many popovers as you like: for each popover you can specify the x and y coords of the button and the id and text of the popover:
    • container.addButton("20%", "50%", "pop1", "test 1");
    • container.addButton("40%", "30%", "pop2", "test 2");
  • Render the container inside your DOM:
    • container.render(document.querySelector("#app"));