@ttfn/viewerjs
v1.2.7
Published
基于[email protected]二次封装。
Downloads
2
Maintainers
Readme
Viewer.js
基于viewerjs的二次封装,下面只列出扩展的 api。
用法
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link rel="stylesheet" href="../dist/viewer.css" />
</head>
<body>
<div id="d">
<img
src="http://1812.img.pp.sohu.com.cn/images/blog/2009/11/18/18/8/125b6560a6ag214.jpg"
/>
<img
src="http://1812.img.pp.sohu.com.cn/images/blog/2009/11/18/18/8/125b6560a6ag214.jpg"
/>
<img
src="http://1812.img.pp.sohu.com.cn/images/blog/2009/11/18/18/8/125b6560a6ag214.jpg"
/>
<video src="http://clips.vorwaerts-gmbh.de/big_buck_bunny.mp4"></video>
</div>
<script src="../dist/viewer.js"></script>
<script src="../dist/viewer.js.map"></script>
<script>
var viewer = new Viewer(document.getElementById("d"), {
renderCanvas: (event) => event.image,
renderNavbar: (event) => event.image,
});
</script>
</body>
</html>
用法
npm i @ttfn/viewerjs -S
API
| 属性 | 描述 | 类型 | 默认值 |
| ---------------- | ------------ | ---------- | ------ |
| renderCanvas | 渲染画布 | function
| - |
| renderNavbar | 渲染导航 | function
| - |
| afterRenderImage | 渲染图片之后 | function
| - |
| playFilter | 幻灯片过滤器 | function
| - |