qer-image-lite
v0.0.3
Published
An open source image viewer which is fast and lightweight.
Downloads
7
Maintainers
Readme
Features
- 📦 Out of the box
- only 2KB size
- tag: ts
- This package is zero-dependency and written in Typescript.
- Simple API
Usage
ES Module
import { imageLite } from 'image-lite';
imageLite.run();
CDN
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/image-lite.js"></script>
<script>
imageLite.run();
</script>
It will be exposed to global as window.imageLite
More APIs
指定需要应用此效果的图片元素
imageLite.run({
include: ['img'], // default ['img']
exclude: ['.exclude'], // default []
});
修改背景颜色
imageLite.run({
backgroundColor: '#333333' // default #ffffff
});
修改动画速度
imageLite.run({
animationTime: '500ms' // default '500ms'
});