You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+8-4Lines changed: 8 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,12 @@
2
2
3
3
A simple plugin for creating responsive [image-maps](https://en.wikipedia.org/wiki/Image_map) that rerender on image or viewport changes.
4
4
5
+
### Install with npm
6
+
```shell
7
+
$ npm install image-map
8
+
```
5
9
6
-
## Usage:
10
+
## Usage
7
11
Add an **image-map** to your html page.
8
12
> 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.
9
13
@@ -18,16 +22,16 @@ Add an **image-map** to your html page.
18
22
</map>
19
23
```
20
24
21
-
### jQuery:
25
+
### jQuery
22
26
To use this plugin with jQuery, include both the [jQuery](https://jquery.com/) and `image-map.js` scripts, then simply call:
23
27
```js
24
28
$('img[usemap]').imageMap();
25
29
```
26
30
27
-
### JavaScript (Vanilla JS):
31
+
### JavaScript (Vanilla JS)
28
32
To use this plugin with *only* JavaScript, include the `image-map.js` script, then simply call:
0 commit comments