• Stars
    star
    319
  • Rank 131,491 (Top 3 %)
  • Language
    JavaScript
  • License
    MIT License
  • Created over 6 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A jQuery plugin wrapper for Viewer.js.

jquery-viewer

Build Status Coverage Status Downloads Version

A jQuery plugin wrapper for Viewer.js.

Main

dist/
โ”œโ”€โ”€ jquery-viewer.js        (UMD)
โ”œโ”€โ”€ jquery-viewer.min.js    (UMD, compressed)
โ”œโ”€โ”€ jquery-viewer.common.js (CommonJS, default)
โ””โ”€โ”€ jquery-viewer.esm.js    (ES Module)

Getting started

Installation

npm install jquery-viewer jquery viewerjs

Include files:

<script src="/path/to/jquery.js"></script><!-- jQuery is required -->
<script src="/path/to/viewer.js"></script><!-- Viewer.js is required -->
<link  href="/path/to/viewer.css" rel="stylesheet">
<script src="/path/to/jquery-viewer.js"></script>

Usage

Initialize with $.fn.viewer method.

<!-- a block container is required -->
<div>
  <img id="image" src="picture.jpg" alt="Picture">
</div>

<div>
  <ul id="images">
    <li><img src="picture-1.jpg" alt="Picture 1"></li>
    <li><img src="picture-2.jpg" alt="Picture 2"></li>
    <li><img src="picture-3.jpg" alt="Picture 3"></li>
  </ul>
</div>
var $image = $('#image');

$image.viewer({
  inline: true,
  viewed: function() {
    $image.viewer('zoomTo', 1);
  }
});

// Get the Viewer.js instance after initialized
var viewer = $image.data('viewer');

// View a list of images
$('#images').viewer();

Options

See the available options of Viewer.js.

$().viewer(options);

Methods

See the available methods of Viewer.js.

$().viewer('method', argument1, , argument2, ..., argumentN);

Events

See the available events of Viewer.js.

$().on('event', handler);

No conflict

If you have to use other plugin with the same namespace, just call the $.fn.viewer.noConflict method to revert to it.

<script src="other-plugin.js"></script>
<script src="jquery-viewer.js"></script>
<script>
  $.fn.viewer.noConflict();
  // Code that uses other plugin's "$().viewer" can follow here.
</script>

Browser support

It is the same as the browser support of Viewer.js. As a jQuery plugin, you also need to see the jQuery Browser Support.

Versioning

Maintained under the Semantic Versioning guidelines.

License

MIT ยฉ Chen Fengyuan

More Repositories

1

cropperjs

JavaScript image cropper.
JavaScript
12,564
star
2

cropper

โš ๏ธ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper
JavaScript
7,759
star
3

viewerjs

JavaScript image viewer.
JavaScript
7,526
star
4

compressorjs

JavaScript image compressor.
JavaScript
4,917
star
5

distpicker

โš ๏ธ [Deprecated] No longer maintained. A simple jQuery plugin for picking provinces, cities and districts of China. (ไธญๅ›ฝ / ็œๅธ‚ๅŒบ / ไธ‰็บง่”ๅŠจ / ๅœฐๅ€้€‰ๆ‹ฉๅ™จ)
JavaScript
1,638
star
6

datepicker

โš ๏ธ [Deprecated] No longer maintained. A simple jQuery datepicker plugin.
JavaScript
1,165
star
7

vue-qrcode

QR code component for Vue.js
TypeScript
1,023
star
8

viewer

โš ๏ธ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-viewer
JavaScript
1,017
star
9

photo-editor

A simple photo editing application.
Vue
920
star
10

jquery-cropper

A jQuery plugin wrapper for Cropper.js.
JavaScript
679
star
11

vue-countdown

Countdown component for Vue.js.
TypeScript
656
star
12

pickerjs

โš ๏ธ [Deprecated] No longer maintained. JavaScript date time picker.
JavaScript
312
star
13

vue-barcode

Bar code component for Vue.js
JavaScript
193
star
14

vue-carousel

Carousel component for Vue.js.
Vue
187
star
15

vue-number-input

Number input component for Vue.js.
TypeScript
173
star
16

vue-feather

Feather component for Vue.js.
TypeScript
144
star
17

simpleui

A simple UI framework for building simple web projects.
CSS
58
star
18

markdown-to-vue-loader

Markdown to Vue component loader for Webpack.
JavaScript
38
star
19

vue-countly

Countly plugin for Vue.js.
JavaScript
11
star
20

load-scripts

Dynamic scripts loading for modern browsers.
JavaScript
10
star
21

create-banner

Create a banner from a package.json file.
JavaScript
7
star
22

postcss-header

Add a header to a file.
JavaScript
3
star