Skip to content

alex-altay/image-map-resizer

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Image Map Resize

npm version license Blazing Donate

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.

Usage

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.

Differences from original library

  • Removed Jquery support
  • Used ES6 syntax
  • Added a function to remove resize listeners to the global object:
window.removeResizerListeners();

Example

http://davidjbradshaw.com/imagemap-resizer/example/

License

Copyright © 2014-19 David J. Bradshaw - Licensed under the MIT license

NPM

About

Responsive HTML Image Maps

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%