
Viewer.js – JavaScript image viewer - chenfengyuan
https://github.com/fengyuanchen/viewerjs
======
silveira
There are usages for this kind of image viewer but frankly I find them very
annoying most of the time. A good example to follow is the Boston Globe's Big
Picture (click in any image at
[https://www.bostonglobe.com/news/bigpicture](https://www.bostonglobe.com/news/bigpicture)
to see a gallery). Just having all images in a good resolution, vertically
stacked in a page has an awesome user experience. I can just scroll which
fells very natural, and images will just load in background. If you want to go
fancy you can have some JS to control in which order the images should load,
and limit the bandwidth.

~~~
yannis
I also dislike "gallery" type of presentations. I also prefer an example
similar to the "bostonglobe.com", perhaps with some blazy effects
[http://dinbror.dk/blazy/](http://dinbror.dk/blazy/).

~~~
k__
I prefer this too.

But I guess that people who know stuff about photography will say the photos
won't get the needed exposure...

------
vortico
Here's my lightbox implementation:

    
    
        <a href="photo.jpg" target="_blank"><img src="photo_thumb.jpg"/></a>
    

Works in all browsers, native, lightweight, public domain.

~~~
janaagaard
=)

I prefer it without the target attribute, generally because I prefer
navigating back than closing a window. This is especially true on phones.
Power users on desktop computers usually know how to open in a tab using the
third mouse button or Ctrl-clicking.

~~~
BHSPitMonkey
If a link opens in a new tab on Android, the back button closes the tab.

~~~
janaagaard
I didn't know that. Neat. Then maybe iOS will get this one day.

I would like some kind of reverse Ctrl-click, that would force links to open
in the same window as the one I'm currently in. I just don't know how this
should work, if I click a link while I'm filling in a form. :-/

------
xbryanx
Might be cool, but I closed my tab immediately. I work on an open team with
quite a few women and other folks who would immediately react negatively to
the sexy Emma Watson example photos. Bring on the downvotes, but even if this
is an irrational negative reaction, it's a real one. If you want this to be a
useful and universal library consider your example images. If you want it to
be used only by people who aren't bothered by this, then plow straight ahead.

It's 2016, let's not propagate the mess that was Lenna:
[https://en.wikipedia.org/wiki/Lenna](https://en.wikipedia.org/wiki/Lenna)

~~~
tjallingt
Why?

Its just an example gallery that happens to be of a photo shoot of Emma
Watson. The photo's aren't even remotely suggestive... Are your female co-
workers that sensitive and/or unable to rationalize? Would you have kept
looking at the demo if it was filled with similar pictures of Brat Pitt?

Not trying to be mean or anything I genuinely don't understand and would like
to know.

EDIT:

I do see and agree that a more varied subject matter would probably do better
to showcase the usage of the plugin but I still think that your reaction is
slightly extreme as it seems like you look down on your female co-workers by
removing their agency in the matter :S (although that might be taking it to
the extreme from my side...)

~~~
Jean-Philipe
Yes, I for one would have kept looking at the demo if it was Brad Pitt.

But that's not the point. Sexism, in reality, favours men and hurts women.
That's why an image of Brad Pitt is okay, whereas an image of Emma Watson is
not okay! (and by the way, they _are_ suggestive)

Any argument that goes "But if we switched genders, then it would be fine!" is
completely missing the point that we are still living in a de-facto
patriarchy, where objectification of men is not even an issue.

In any case, I found the choice of images immature and closed the website
right away.

~~~
mycroft-holmes
> Yes, I for one would have kept looking at the demo if it was Brad Pitt.

That makes you the sexist in this instance.

~~~
Jean-Philipe
Because I try to be sensitive to sexism and react accordingly, that makes me
sexist?

~~~
mycroft-holmes
No, because you're treating each sex differently based on their sex.

------
JohnnieWalker
I don't want to be negative put performance is really not that great
(specially when pinching), there is simply no comparison to native (massive
lag/unresponsive) It's certainly possible to build web native par photo
viewers (I've done it) I'll try to open source my implementation soon. However
props to the author it seems to have good documentation and well thought out
features.

------
starikovs
Works great! (btw, here's mine
[https://github.com/starikovs/stupidbox](https://github.com/starikovs/stupidbox)
%-)

------
afloatboat
I occassionally use PhotoSwipe when I need an image viewer
([http://photoswipe.com/documentation/getting-
started.html](http://photoswipe.com/documentation/getting-started.html)). Bit
of a pain to implement, but I really like the way it works both on desktop and
mobile and the fact that it has linkable URLs.

For all the over the top options that ViewerJS seems to have, I find it
strange that a simple 'click background to close' option is missing.

------
joshribakoff
Tested it for about 30 seconds & found numerous bugs. Scrolling with my Apple
Magic touchpad is very buggy. As I scroll up it zooms in 90% of the time, but
randomly 10% of the time it reverses the zoom direction so scrolling up zooms
out. When I click on the "zoom out" button on the bottom of the screen, the
image zooms out but starts moving off the page, as if the width/height are
changed but the left/top aren't updated. This does not appear to be production
ready.

------
chinathrow
Nice.

What seems to be missing is the forward/backward links within each 50% of the
image width.

------
ajsharp
The open animation is way too slow. Not great UX.

------
miyuru
since github is down atm
[http://fengyuanchen.github.io/viewerjs/](http://fengyuanchen.github.io/viewerjs/)

------
lukasm
There should be X to close the image

~~~
rogeryu
Clicking outside the image should close it. That's pretty standard nowadays.

~~~
joshstrange
It doesn't for me I had to use ESC.

~~~
starikovs
I've just found out that some users (not hackers) click or tap somewhere if
they want to close or do something with it even if they don't know how to
interact with it in the next step.

------
sysrpl
Bah, I think my solution looks better, and it's mostly all CSS transitions
(simpler) -> [http://cache.getlazarus.org/videos/flip-
photos.mp4](http://cache.getlazarus.org/videos/flip-photos.mp4)

------
TheTravCav
works great. lots of features. easy to use. I like it.

------
Zyst
Ha! I was looking exactly for something like this (Zoom/rotate)

Sweet, I lucked out.

------
ycthrowaway1
lots of +1 for using emma watson, she is also pretty sideways.

However, i did experience a blocking wait for > 5 seconds "Waiting for
[http://.."](http://..") some fusion ads or something. In UX terms, it is
quite important that image loading ( -> fullscreen on click) is not blocked.

------
sysrpl
Bah, I think mine which is pure css transitions is better ->
[http://cache.getlazarus.org/videos/flip-
photos.mp4](http://cache.getlazarus.org/videos/flip-photos.mp4)

And simpler too.

