Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lete114/simple-image-preview

A lightweight image preview library
https://github.com/lete114/simple-image-preview

image preview preview-image previewer view-image

Last synced: 16 days ago
JSON representation

A lightweight image preview library

Awesome Lists containing this project

README

        

# Simple-Image-Preview

A lightweight image preview library

- preview site: [https://lete114.github.io/simple-image-preview](https://lete114.github.io/simple-image-preview)

## Installation

```bash
npm install simple-image-preview
```

Or

```html

```

## Usage

```js
import simpleImagePreview from 'simple-image-preview'

// Pass in a css selector (default: img)
simpleImagePreview('main img') // will select all `img` tags under the `main` tag

// Pass in a NodeList data structure
const imgs = document.querySelectorAll('main img')
simpleImagePreview(imgs)

// custom z-index (default: 1)
simpleImagePreview('main img', { zIndex: 100 })
```

## options

### zIndex

Type: `Number`

Default: `1`

custom z-index