This is fork of David Bradshaw simple library that makes HTML Image Maps responsive, so that they automagically stay scaled to the size of the image they are attached to. It detects the window being resized and updates the co-ordinates of the image map accordingly.
Include the imageMapResizer.min.js script then add the following call to the bottom of your page:
imageMapResize();
Optionally you can pass a CSS selector that returns a collection of map tags, for example 'map.myMap'. Or a direct reference to a map object in the DOM. This function returns an array of map elements that it has been bound to.
- Removed Jquery support
- Used ES6 syntax
- Added a function to remove resize listeners to the global object:
window.removeResizerListeners();
http://davidjbradshaw.com/imagemap-resizer/example/
Copyright © 2014-19 David J. Bradshaw - Licensed under the MIT license