• Stars
    star
    118
  • Rank 298,179 (Top 6 %)
  • Language
    JavaScript
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Responsive, dynamic image maps.

NPM release Build Status

Image-Map

image-map

A native JavaScript solution for creating responsive image-maps that rerender on image or viewport changes.

Check out the demo!

Installation

Install with npm

$ npm install image-map

Install with bower

$ bower install image-map

CDN

Module (.es.js) Main (.js) Main (compressed) .min.js
πŸ”— πŸ”— πŸ”—

Generating the image map html

You can generate image maps using this wonderful online tool: https://www.image-map.net/. It works for both local and web images.

Usage

Add an image-map to your html page (either create one yourself or try the online image map generator).

An image-map is an image with clickable areas. The required name attribute of the <map> element is associated with the <img>'s usemap attribute and creates a relationship between the image and the map. The <map> element contains a number of <area> elements, that defines the clickable areas in the image map.

<img usemap="#image-map" src="/path/to/image">

<map name="image-map">
      <area shape="poly" coords="22,22,231,22,264,82,232,143,22,143">
      <area shape="poly" coords="233,22,443,22,476,82,442,144,233,143,264,82">
      <area shape="poly" coords="445,22,654,22,686,81,654,143,444,143,475,82">
      <area shape="poly" coords="655,22,895,22,895,142,655,142,684,82">
</map>

JavaScript

To use this plugin with only JavaScript, first include (or import) the image-map.js library:

// using `import`
import ImageMap from "image-map";
// using `require`
var ImageMap = require("image-map");
<!-- using `script` -->
<script src="https://unpkg.com/image-map/dist/image-map.js"></script>

Next, simply call the ImageMap constructor:

ImageMap('img[usemap]')

The default debounce rate is 500ms. To customize this value, pass a numeric wait value as the second argument.

ImageMap('img[usemap]', 500)

jQuery

To use this plugin with jQuery, first include both the jQuery and image-map.jquery.js libraries:

<!-- using `script` -->
<script src="https://unpkg.com/jquery/dist/jquery.js"></script>
<script src="https://unpkg.com/image-map/dist/image-map.jquery.js"></script>

Next, simply call the imageMap plugin:

$('img[usemap]').imageMap();

The default debounce rate is 500ms. To customize this value, pass a numeric wait value as the first argument.

$('img[usemap]').imageMap(500);

More Repositories

1

proxy-list

A list of free, public, forward proxy servers. UPDATED DAILY!
2,083
star
2

TableExport

The simple, easy-to-implement library to export HTML tables to xlsx, xls, csv, and txt files.
JavaScript
879
star
3

s3recon

Amazon S3 bucket finder and crawler.
Python
123
star
4

mergedeep

A deep merge function for 🐍.
Python
117
star
5

wait-for-it

Wait for service(s) to be available before executing a command.
Python
63
star
6

zsh-completions

Additional completion definitions for Zsh. UPDATED DAILY!
Shell
50
star
7

json

Drop-in replacement for Golang encoding/json with additional features.
Go
42
star
8

jwt-cli

Command line tool for working with JSON Web Tokens (JWT)
JavaScript
38
star
9

saga-monitor

Simple, elegant, and configurable redux-saga monitor
JavaScript
36
star
10

hugo-elasticsearch

Generate Elasticsearch indexes for Hugo static sites by parsing front matter
JavaScript
27
star
11

java-design-patterns

Catalog of popular object-oriented design patterns in Java
Java
21
star
12

ncalc

Command line utility for quick number base conversions ( ascii / binary / octal / decimal / hexadecimal )
Go
19
star
13

pprintjson

A json pretty printer for Python 🐍
Python
14
star
14

myip

Command line utility for displaying public and private IP addresses
Go
13
star
15

pprintast

An AST pretty printer for Python 🐍
Python
13
star
16

super

Data structures, data types, and algorithms with superpowers! πŸ’ͺ😎
JavaScript
12
star
17

jwt-token-generator

Generate JWT Token using Unix command line tools
Shell
11
star
18

go-bash-wrapper

Run bash scripts with Golang
Go
10
star
19

tableexport_flask_app

TableExport + Flask sample app
Python
9
star
20

highcharts-more

Universal highcharts-more module for the popular JavaScript charting framework Highcharts
JavaScript
8
star
21

hugo-lunr-indexer

Generate Lunr indexes for Hugo static sites by parsing front matter
JavaScript
8
star
22

SortAlgorithms

Sorting algorithm visualization using D3
CSS
8
star
23

React-generators

Generator templates for React using ES6/React best practices
JavaScript
8
star
24

docker-wrapper

Docker command wrapper.
Shell
8
star
25

HackerRank-Python

HackerRank Python Solutions
Python
7
star
26

generator-node-cli-commander

Node command line application generator.
JavaScript
7
star
27

linux-from-scratch

A list of files, scripts, and documentation for Linux From Scratch - Version 8.0
Shell
7
star
28

generator-node-cli

Node command line application generator.
JavaScript
7
star
29

check

Check if a TCP/UDP port is open on a host(s) using UNIX command line tools.
Shell
7
star
30

HackerRank-Java

HackerRank Java Solutions
Java
7
star
31

bitflag

A simple bit flag class for Python 🐍
Python
7
star
32

SearchableList

Extend doubly linked list `list.go` with search methods
Go
7
star
33

csv-2-mongo

Import a CSV to MongoDB
Python
7
star
34

movie-picker

Find something to watch on Netflix when the family is in town!
JavaScript
7
star
35

QueryTag

The simple, easy-to-implement jQuery plugin that allows you to add popular search queries from a Google Custom Search Engine (CSE) to your website as sortable, filterable, and stylable keyword tags.
CSS
7
star
36

i18n-api-node

Internationalization (I18n) API - Node
JavaScript
6
star
37

HackerRank-Bash

HackerRank Bash Solutions
Shell
6
star
38

calculator

React Native calculator
JavaScript
6
star
39

tableexport_angular4_webpack2_app

TableExport + Angular 4 + Webpack 2 sample app
JavaScript
6
star
40

realtime-twitter-feed

Realtime Twitter feed using Angular2, Twitter, Google Maps, Express, and Socket.io
CSS
6
star
41

react-microservice-boilerplate

A scalable React boilerplate with a built-in API layer for modern microservice architectures.
5
star
42

TableExport-docs

TableExport Documentation
CSS
5
star
43

systemstat

Command line utility for displaying process and system information
Go
5
star
44

tableexport_webpack-v1_app

TableExport + Webpack1 sample app
JavaScript
5
star
45

tcp

List open TCP connections
Go
5
star
46

babel-preset-clarketm-react-app

Customized Babel preset for Create React App
JavaScript
5
star
47

public-ip

A simple public IP address API
5
star
48

DeepClone

Light-weight deep clone implementation for JavaScript.
JavaScript
5
star
49

InterviewPracticeProblems

JavaScript
4
star
50

supermap

Map with superpowers!
JavaScript
4
star
51

Jenkins

Jenkins with Docker support
Dockerfile
4
star
52

python-project-skeleton

Python boilerplate and sample project structure.
4
star
53

MenuAnimate

Enhance your website with six stylish menu transformicons using SCSS (or LESS) and CSS.
CSS
4
star
54

chatbot

Go
4
star
55

HackerRank-C

HackerRank C/C++ Solutions
C++
4
star
56

superobject

Object with superpowers!
JavaScript
4
star
57

Rotate

The simple, easy-to-implement animation plugin to rotate icons, images, and elements.
JavaScript
4
star
58

react-lifecycle

Understanding the React Component Lifecycle
JavaScript
4
star
59

tsaleh-vim-tcomment

An easily extensible & universal comment plugin.
Vim Script
4
star
60

blog-api-node

Blog API - Node
JavaScript
4
star
61

HackerRank

HackerRank Solutions
4
star
62

tableexport_requirejs_app

TableExport + RequireJS sample app
HTML
4
star
63

microservice-architecture-node

Scalable microservices system using Loopback and Node.
4
star
64

express-webhook-example

Real-time Express API leveraging Webhooks
JavaScript
4
star
65

express-sse-example

Real-time Express streaming API leveraging Server Sent Events (SSE)
JavaScript
4
star
66

sonos-node

Fork of https://github.com/bencevans/node-sonos optimized for Node v6.10.3 LTS
JavaScript
4
star
67

connect-starhackit-app

JavaScript
3
star
68

connect-dva-app

JavaScript
3
star
69

7DaysOfJavaScript

JavaScript
3
star
70

connect-reactGo-app

JavaScript
3
star
71

connect-react-starter-kit

JavaScript
3
star
72

jzip

JavaScript
3
star
73

HackerRank-JavaScript

HackerRank JavaScript Solutions
JavaScript
3
star
74

ajGingrich.github.io

HTML
3
star
75

i18n-Interpolator

Internationalization (i18n) string interpolator
JavaScript
3
star
76

connect-kyt-app

JavaScript
3
star
77

HungryHokie

Java
3
star
78

connect

JavaScript
3
star
79

connect-reactql-app

JavaScript
3
star
80

UniversalRelayBoilerplate

JavaScript
3
star
81

connect-vulcan-app

JavaScript
3
star
82

create-react-server

JavaScript
3
star
83

aurelia-tutorial

A starter kit for building a standard app with Aurelia.
JavaScript
3
star
84

JavaScript-design-patterns

Catalog of popular object-oriented design patterns using the latest ECMAScript features
3
star
85

pj

Command line tool for working with ProwJobs (PJ)
Go
2
star
86

prow

A Kubernetes based CI/CD system (mirror of kubernetes/test-infra/prow)
Go
2
star
87

Boggle

Boggle
JavaScript
1
star
88

vim

Vim Script
1
star
89

HackerRank-SQL

HackerRank SQL Solutions
1
star
90

gloo-tutorial

Gloo Tutorial
Shell
1
star