MainA jQuery plugin wrapper for Viewer.js.
Getting started Installationdist/
âââ jquery-viewer.js        (UMD)
âââ jquery-viewer.min.js    (UMD, compressed)
âââ jquery-viewer.common.js (CommonJS, default)
âââ jquery-viewer.esm.js    (ES Module)
npm install jquery-viewer jquery viewerjs
Include files:
Usage<script src="/path/to/jquery.js"></script>
<script src="/path/to/viewer.js"></script>
<link  href="/path/to/viewer.css" rel="stylesheet">
<script src="/path/to/jquery-viewer.js"></script>
Initialize with $.fn.viewer
method.
<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>
Optionsvar $image = $('#image');
Â
$image.viewer({
  inline: true,
  viewed: function() {
    $image.viewer('zoomTo', 1);
  }
});
Â
var viewer = $image.data('viewer');
Â
$('#images').viewer();
See the available options of Viewer.js.
MethodsSee the available methods of Viewer.js.
Events$().viewer('method', argument1, , argument2, ..., argumentN);
See the available events of Viewer.js.
No conflict$().on('event', handler);
If you have to use other plugin with the same namespace, just call the $.fn.viewer.noConflict
method to revert to it.
Browser support<script src="other-plugin.js"></script>
<script src="jquery-viewer.js"></script>
<script>
  $.fn.viewer.noConflict();
 Â
</script>Â
It is the same as the browser support of Viewer.js. As a jQuery plugin, you also need to see the jQuery Browser Support.
VersioningMaintained under the Semantic Versioning guidelines.
LicenseMIT © Chen Fengyuan
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4