# mobileviewer

> image preview in the mobile

Latest version **1.0.2** (published 2020-05-12) · ISC license · 0 weekly downloads

## Install

```sh
npm install mobileviewer
pnpm add mobileviewer
yarn add mobileviewer
bun add mobileviewer
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2020-05-12 |
| First published | 2020-05-11 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 11.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | waeKing chen |
| Maintainers | waeking |
| Keywords | mobile, viewer, previewImage |

## Links

- npm: https://www.npmjs.com/package/mobileviewer
- Repository: https://github.com/waeking/mobileviewer
- Issues: https://github.com/waeking/mobileviewer/issues
- npm.io page: https://npm.io/package/mobileviewer

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2020-05-12
- 1.0.1 — 2020-05-11
- 1.0.0 — 2020-05-11

## README

## 开始

### 安装

```shell
npm install mobileviewer
```

### 或者下载源码在浏览器直接引入:

```html
<script src="/path/to/mobileviewer.js"></script>
```
### 使用方式:
#### 方式1

#### 例子

```html
// THE FIRST：

<div>
  <img id="imageWrap" src="pic.jpg" alt="pic">
</div>

// THE SECOND：

<div>
  <ul id="imageWrap">
    <li><img src="pic1.jpg" alt="pic1"></li>
    <li><img src="pic2.jpg" alt="pic2"></li>
    <li><img src="pic3.jpg" alt="pic3"></li>
  </ul>
</div>
```

```js
import mobileviewer from 'mobileviewer';

// THE FIRST：
var mobileView = mobileviewer.init(document.getElementById('imageWrap'));

// THE SECOND
var mobileViewList = mobileviewer.init(document.getElementById('imageWrap'));
// Then, show one image by click it, it will auto show the image`.
```

#### 方式2
```js
mobileviewer.previewImage({
  current: '', // 当前显示图片的http链接
  urls: [] // 需要预览的图片http链接列表
});
```

---
_Source: https://npm.io/package/mobileviewer · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
