⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-viewer

Overview

Viewer

Build Status Downloads Version Dependencies

A simple jQuery image viewing plugin. As of v1.0.0, the core code of Viewer is replaced with Viewer.js.

  • Demo
  • Viewer.js - JavaScript image viewer (recommended)
  • jquery-viewer - A jQuery plugin wrapper for Viewer.js (recommended for jQuery users to use this instead of Viewer)

Main

dist/
├── viewer.css
├── viewer.min.css   (compressed)
├── viewer.js        (UMD)
├── viewer.min.js    (UMD, compressed)
├── viewer.common.js (CommonJS, default)
└── viewer.esm.js    (ES Module)

Getting started

Installation

npm install imageviewer jquery

Include files:

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

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="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

Comments
  • 快速连续点击 会报 Error: Stack overflow

    快速连续点击 会报 Error: Stack overflow

    快速连续点击下面某两个的按钮,浏览器会卡死,然后报:Error: Stack overflow 必须要等某个操作完成之后(比如旋转)点击才正常。 如果每个操作在完成之后都能回调,建议在点击之后增加一个状态,如果某个操作未完成,点击无效。

    另外,不得不说作者开发的这个插件功能确实很强大,之前一直用fancybox,现在全部替换成viewer
    
    opened by raofeng 6
  • Improve performance for lots of thumbnails?

    Improve performance for lots of thumbnails?

    Hi,

    Would it be possible to introduce some methods in order to improve the performance of the image viewer - for example, I am trying to load the image viewer with about 800 images. Would it be possible to defer or lazy load the thumbnails which are not yet visible when first invoked? There is another javascript image viewer which offers this functionality: http://galleria.io/docs/references/optimize/#lazy-load-thumbnails See points 3 and 6 in the above link.

    Please let me know what you think. Thanks for your image viewer!

    opened by nabeygun 5
  • Parent with position: fixed

    Parent with position: fixed

    When I use Viewer for images inside fixed-position block, it opens inside this block, not fillings all browser window. Fullscreen mode also do not work at this situation.

    opened by vatavale 3
  • Open the viewer automatically

    Open the viewer automatically

    Hello good day.

    Is there any way to automatically open the viewer , displaying the first image in the gallery?

    Thanks for the support and congratulations for the work .

    Regards, Marcelo

    opened by marcelotq 2
  • Mouse wheel zoom in outside pic

    Mouse wheel zoom in outside pic

    When I wheel my mouse in Red area,the picture still zoom. But For Move action, I must mouse "on" Picture. Can i zoom pic like move action ,only reaction when mouse on pic.

    qq 20160527154236

    opened by paul2008 2
  • 标题不能正常显示(The title do not show properly)

    标题不能正常显示(The title do not show properly)

    首先,请原谅我可能很难读懂的英文。下面我将描述这个情况。 (First, Please ignore my bad English. Next, I will describe this question.)

    使用版本:Viewer v0.4.0 (Version:Viewer v0.4.0)

    在实例化插件并打开图片后,Viewer没有按照我想的显示标题。 (After the instantiation and open image, Viewer shows no title.) 在查看源码后我发现,在view函数中,标题的显示是通过绑定EVENT_VIEWED事件,并触发该事件后才显示。 (After see the source, At function view, After the title displayed in the bind EVENT_VIEWED, and trigger this event.) 但是在使用中,我发现EVENT_VIEWED事件会在绑定之前触发。所以导致标题无法正常显示。 (But, I see trigger EVENT_VIEWED at before bind EVENT_VIEWED. So title do not show.) 在我的代码中,我注释了EVENT_VIEWED事件,并在这个位置直接显示了标题,并期待有更好的做法。 (At my source, I hide event EVENT_VIEWED, And in this position at once show title,I look forward to have better way.)

    最后,感谢这个插件给我的帮助. (Thank you for yours plug-in's help for me.)

    opened by sudot 2
  • 修改重建图片列表预览问题

    修改重建图片列表预览问题

    当在原来的图片列表选中一个序号较大的图片后,重建图片列表的长度比该序号小,下次的viewer.show()无法预览图片

    PR Checklist

    Please check if your PR fulfills the following requirements:

    • [ ] The commit message follows our guidelines.
    • [ ] Tests for the changes have been added (for bug fixes / features)
    • [ ] Docs have been added / updated (for bug fixes / features)

    PR Type

    What kind of change does this PR introduce?

    [ ] Bugfix
    [ ] Feature
    [ ] Code style update
    [ ] Refactor
    [ ] Build related changes
    [ ] Documentation content changes
    [ ] Other, Please describe:
    

    What is the current behavior?

    Issue Number: N/A

    What is the new behavior?

    Does this PR introduce a breaking change?

    [ ] Yes
    [ ] No
    

    Other information

    opened by ghost 1
  • * Viewer.js 在IOS 13 中的BUG 重要

    * Viewer.js 在IOS 13 中的BUG 重要

    陈老师 发现Viewer在IOS13中发现一个问题 点开图片竟然不能移动 而且不能放大 但是在IOS13以下版本都正常 这个项目是H5页面 const viewer = new Viewer(img, { toolbar: false,navbar: false, title: false, toolbar: { zoomIn: 1, zoomOut: 1, oneToOne: 0, reset: 0, prev: 0, play: 0, next: 0, rotateLeft: 1, rotateRight: 1, flipHorizontal: 0, flipVertical: 0, } })

    opened by leijc 1
  • build(deps-dev): bump jquery from 3.3.1 to 3.4.0

    build(deps-dev): bump jquery from 3.3.1 to 3.4.0

    Bumps jquery from 3.3.1 to 3.4.0.

    Commits
    • b7fc909 3.4.0
    • 59ea765 Release: update AUTHORS.txt
    • 7c1ef15 Release: update version to 3.4.0-pre
    • d940bc0 Build: Update Sizzle from 2.3.3 to 2.3.4
    • 9b9fca4 Update README.md
    • a2a73db Tests: Make Android Browser 4.0-4.3 dimensions tests green
    • 4455f8d Tests: Make Android Browser 4.0-4.3 AJAX tests green
    • 0050403 Core: Preserve CSP nonce on scripts with src attribute in DOM manipulation
    • fe5f04d Event: Prevent leverageNative from double-firing focusin
    • 753d591 Core: Prevent Object.prototype pollution for $.extend( true, ... )
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot ignore this [patch|minor|major] version will close this PR and stop Dependabot creating any more for this minor/major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot use these labels will set the current labels as the default for future PRs for this repo and language
    • @dependabot use these reviewers will set the current reviewers as the default for future PRs for this repo and language
    • @dependabot use these assignees will set the current assignees as the default for future PRs for this repo and language
    • @dependabot use this milestone will set the current milestone as the default for future PRs for this repo and language

    You can disable automated security fix PRs for this repo from the Security Alerts page.

    dependencies 
    opened by dependabot[bot] 1
Releases(v1.1.0)
  • v1.1.0(Dec 14, 2019)

  • v1.0.0(Apr 1, 2018)

  • v1.0.0-beta(Apr 1, 2018)

  • v1.0.0-alpha(Mar 11, 2018)

  • v0.7.0(Mar 11, 2018)

  • v0.6.0(Oct 7, 2017)

  • v0.5.1(Mar 11, 2016)

  • v0.5.0(Jan 21, 2016)

    • Add more available values to the "title", "toolbar" and "navbar" options.
    • Support to toggle the visibility of title, toolbar and navbar between different screen widths.
    • Exit fullscreen when stop playing.
    • Fixed title not generated bug (#6).
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Jan 1, 2016)

  • v0.3.1(Dec 28, 2015)

  • v0.3.0(Dec 24, 2015)

    • Add 2 new options: "view" and "viewed"
    • Add 2 new events: "view" and "viewed"
    • Add keyboard support: stop playing when tap the Space key
    • Fix lost transition after call full method in inline mode
    • Fix incorrect tooltip after switch image quickly
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Oct 18, 2015)

  • v0.1.1(Oct 7, 2015)

  • v0.1.0(Sep 2, 2015)

    • Supports 28 options: inline, button, navbar, title, toolbar, tooltip, movable, zoomable, rotatable, scalable, transition, fullscreen, keyboard, interval, minWidth, minHeight, zoomRatio, minZoomRatio, maxZoomRatio, zIndex, zIndexInline, url, build, built, show, shown, hide, hidden
    • Supports 21 methods: show, hide, view, prev, next, move, zoom, zoomTo, rotate, rotateTo, scale, scaleX, scaleY, play, stop, full, exit, tooltip, toggle, reset, destroy
    • Supports 6 events: build.viewer, built.viewer, show.viewer, shown.viewer, hide.viewer, hidden.viewer
    Source code(tar.gz)
    Source code(zip)
Owner
Fengyuan Chen
Fengyuan Chen
DEPRECATED jQuery Responsive Carousel.

YEAH SO THIS IS PRETTY MUCH DEAD, DO YOURSELF A FAVOR AND SWITCH TO tiny-slider Owl Carousel 2 Touch enabled jQuery plugin that lets you create a beau

null 7.7k Jan 4, 2023
null 3.9k Dec 30, 2022
jQuery plugin that blows your visitors' retinas

Dense.js Homepage | Issues | Dense is a jQuery plugin for serving retina-ready, high pixel ratio images with ease. Small, ease-to-adapt, yet very cust

Jukka Svahn 212 Jun 30, 2022
A jQuery plugin that displays a thumbnail grid expanding preview similar to the effect seen on Google Images.

jQuery GRIDDER 1.4.2 ======= A jQuery plugin that displays a thumbnail grid expanding preview similar to the effect seen on Google Images. We have all

Orion Gunning 455 Nov 6, 2022
jQuery plugin that makes an image erasable (with mouse or touch movements)

jQuery.eraser v0.5.2 a jQuery plugin that makes an image erasable (with mouse or touch movements) This plugin replaces the targeted image by an intera

boblemarin 327 Oct 27, 2022
jQuery plugin based on raphael.js that allows you to display dynamic vector maps

jQuery Mapael - Dynamic vector maps The complete documentation is available on Mapael website (repository: 'neveldo/mapael-documentation'). Additional

Vincent Brouté 1k Jan 5, 2023
A jquery plugin for comparing two images

jQuery Images Compare A jquery plugin for comparing two images Badges Features compatibility : ie9+ Effort to put appearance via css (easier to skin /

Sylvain Combes 49 Sep 5, 2022
Nivo Slider - The Most Awesome jQuery Image Slider

Maintainer's Wanted! - Ineterested in contributing regularly to Nivo Slider development? Get in touch Nivo Slider The Nivo Slider is world renowned as

Verti Studio 1.2k Dec 24, 2022
Unite Gallery - Responsive jQuery Image and Video Gallery Plugin. Aim to be the best gallery on the web on it's kind. See demo here:

##Unite Gallery - Responsive jQuery Gallery Plugin Product Link: unitegallery.net This gallery has commercial versions for: WordPress , Joomla! , Pres

Max Valiano 531 Oct 24, 2022
jQuery plugin for 'responsive cropping'. Dynamically crop images to fill available space without cutting out the image's subject. Great for full-screen images.

jQuery plugin for 'responsive cropping'. Dynamically crop images to fill available space without cutting out the image's subject. Great for full-screen images.

Jono Menz 3.2k Dec 30, 2022
Codecs lets you use read, write, edit, and analyze images.

Codecs Codecs lets you use read, write, edit, and analyze images. npm install @astropub/codecs Usage import * as fs from 'node:fs/promises' import * a

Astro Community 8 Oct 10, 2022
⚠️ [Deprecated] No longer maintained, please use https://github.com/fengyuanchen/jquery-cropper

Cropper A simple jQuery image cropping plugin. As of v4.0.0, the core code of Cropper is replaced with Cropper.js. Demo Cropper.js - JavaScript image

Fengyuan Chen 7.8k Dec 27, 2022
⚠️ This project is not maintained anymore! Please go to https://github.com/visjs

vis.js (deprecated!) ❗ This project is not maintained anymore! (See Issue #4259 for details) We welcome you to use the libraries from the visjs commun

null 7.9k Dec 27, 2022
A JSON polyfill. No longer maintained.

?? Unmaintained ?? JSON 3 is **deprecated** and **no longer maintained**. Please don't use it in new projects, and migrate existing projects to use th

BestieJS Modules 1k Dec 24, 2022
No longer maintained, superseded by JS Cookie:

IMPORTANT! This project was moved to https://github.com/js-cookie/js-cookie, check the discussion. New issues should be opened at https://github.com/j

Klaus Hartl 8.6k Jan 5, 2023
CasperJS is no longer actively maintained. Navigation scripting and testing utility for PhantomJS and SlimerJS

CasperJS Important note: the master branch hosts the development version of CasperJS, which is now pretty stable and should be the right version to us

CasperJS 7.3k Dec 25, 2022
No longer actively maintained.

Vide No longer actively maintained. I am not interested to maintain jQuery plugins anymore. If you have some fixes, feel free to make PR. Easy as hell

Ilya Caulfield 3.3k Dec 20, 2022
No longer actively maintained.

Remodal No longer actively maintained. I am not interested to maintain jQuery plugins anymore. If you have some fixes, feel free to make PR. Responsiv

Ilya Caulfield 2.8k Dec 11, 2022
Source code for the deprecated expo-google-app-auth package. Deprecated in favor of expo-auth-session.

expo-google-app-auth Source code for the deprecated expo-google-app-auth package. Expo Google App Auth API wrapped the deprecated expo-app-auth packag

Expo 4 Nov 2, 2022
DEPRECATED. Zeppelin has moved to Apache. Please make pull request there

Zeppelin has moved to Apache. Zeppelin's has moved to Apache incubator. This github repository is not going to be synced to the ASF's one after 20/Mar

ZEPL 417 Dec 15, 2022