-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,50 @@ | ||
# element-inspector.js | ||
|
||
[![Build Status](https://travis-ci.org/cou929/element-inspector.js.svg?branch=master)](https://travis-ci.org/cou929/element-inspector.js) | ||
|
||
Inspect DOM elements like developer tools of browser | ||
|
||
![demo](/example/demo.gif) | ||
|
||
## Example | ||
|
||
```js | ||
new ElementInspector({ | ||
// target element to enable inspector | ||
targetSelector: 'body' | ||
}); | ||
``` | ||
|
||
## Constructor | ||
|
||
### `targetSelector` | ||
|
||
The target element to enable inspector. Required. | ||
|
||
### `onMousemove` | ||
|
||
Callback function of mousemove event. The argument of callback is event object. | ||
|
||
### `onOverlayClicked` | ||
|
||
Callback function of click event of overlay element, which indicates the dom of current mouse position. The argument of callback is event object. | ||
|
||
### `overlayBackgroundColor` | ||
|
||
Background color of overlay. Default is `rgba(102, 204, 255, 0.5)` (semitransparent light blue). | ||
|
||
## Instance methods | ||
|
||
### `showOverlay()` | ||
|
||
Show overlay. | ||
|
||
### `hideOverlay()` | ||
|
||
Hide overlay. | ||
|
||
## Test | ||
|
||
``` | ||
npm test | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.