Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/lete114/simple-image-preview
- Owner: Lete114
- License: mit
- Created: 2023-05-06T11:21:04.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-10-04T09:01:51.000Z (about 1 year ago)
- Last Synced: 2024-11-30T09:48:10.618Z (about 1 month ago)
- Topics: image, preview, preview-image, previewer, view-image
- Language: TypeScript
- Homepage: https://lete114.github.io/simple-image-preview
- Size: 28.3 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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