Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
cou929 committed Mar 22, 2015
1 parent d8de07f commit 5741eb0
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions README.md
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
```
Binary file added example/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5741eb0

Please sign in to comment.