kthornbloom / Smoothproducts

A simple, lightweight and responsive product image viewer using jQuery
kthornbloom.com/smoothproducts
185 stars 89 forks source link

Close when tapping outside lightbox / zooming comments #13

Closed pflind closed 9 years ago

pflind commented 9 years ago

Wouldn't it be great with zooming capabilities on touch devices? At least I think it's a draw back that you can't view image details if you're using a touch device. Touch devices usually have small screens, which could benefit from a zoom function more so than on desktop devices. I did tests on a Win 10/Edge touch tablet and a iPhone 6 with latest iOS.

Another, small UI thing. When you touch outside the lightbox it should close the lightbox, same behavior as on desktop. This should be fixed. It works on my Win tablet but not on iPhone.

This is a great little script overall, many thanks!

kthornbloom commented 9 years ago

Hi, this script has gone through many changes over the years. At one point, it did have zoom that even attempted to use the phone's gyroscope to pan around the zoomed-in image.

Unfortunately, since I use this on production projects, I've found that most users are annoyed with being zoomed in to a tiny detail. They'd rather see the whole image larger. So that's how I've updated it. Feel free to look back through old versions though!

Touching outside the lightbox should close it. I may have had an old version up on my demo. I just fixed that so you may try it again.

pflind commented 9 years ago

Hi, and thank you!

Touching outside the lightbox doesn't work on iPhone 6. I tested in both portrait and landscape mode. Neither your demo page nor the downloaded local copy works.

kthornbloom commented 9 years ago

Thanks for the report! I'll look into it. I've modified this issue to be more related to that bug.

yabdab commented 9 years ago

Quick fix.

.sp-lightbox { cursor: pointer; }

kthornbloom commented 9 years ago

@yabdab I've added your suggestion. I don't have an iPhone 6 to test with. Let me know if it helps resolve the issue!

yabdab commented 9 years ago

@kthornbloom I added it with my own copy here and it works fine.