pretty-preview
v1.1.2
Published
A pretty image preview for browser
Downloads
7
Maintainers
Readme
PrettyPreview
Demo
Install
Install with npm:
npm i pretty-preview
Install with yarn:
yarn add pretty-preview
Install with pnpm:
pnpm add pretty-preview
Usage
import PrettyPreview from 'pretty-preview'
import 'pretty-preview/index.css'
const pp = new PrettyPreview({
root: '.wrapper'
})
Params
|param|type|default|description| |:--|:--|-|-| |root|HTMLElement | string|document.body|The parent element to listen on.| |selector|string|'img'|The element to listen on.| |srcAttr|string|'src'|The property that need to be collected from the selector| |useMask|boolean|true|-| |loop|boolean|false|Enable infinite loop switching between pictures|
License
MIT License © 2022-PRESENT Humandetail