Skip to content

humandetail/pretty-preview

Repository files navigation

pretty-review


Project Activity

Project Activity

Demo

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'

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