natashawylie / iviewer

image viewer plugin for jquery
233 stars 97 forks source link

iviewer does not allow dragging until zoomed out to edges #59

Open HongPong opened 11 years ago

HongPong commented 11 years ago

Hi, nifty plugin. When I set up a script to be zoomed in on a large photo, it does not have a draggable behavior until after i zoom out enough to reach the edge, and then zoom back in again. So if I zoom out far enough to expose the area beyond the top & bottom of the pic, then i can scroll left and right. It seems like the demo page for this script has same behavior, at least on Chrome/OSX. Is there a way to make everything more conventionally draggable immediately at load time? I could be mistaken or misconfigured something but it's working the same as the demo site. thank you.

can3p commented 11 years ago

Can you try to reproduce this bug in other browsers? What version of browser/chrome do you have?

HongPong commented 11 years ago

OSX 30.0.1599.101 . and Safari Version 6.1 (7537.71), and Firefox 25.0 i definitely get the behavior at http://test.dpetroff.ru/jquery.iviewer/test/

can3p commented 11 years ago

I've tried to reproduce it in the Firefox 25.0 and did not succeed.

The top image on the test should not be draggable (see the source code for comment), the bottom image cannot be dragged on the page load because it has the value of the zoom to fit in the container. If I press zoom in I can drag the photo and if I zoom out to seed blank borders around the image then I cannot drag it anywhere, which is correct behavior.

Is there something that I've done incorrectly to reproduce the bug?

umdstu commented 9 years ago

@can3p - I think what @HongPong was possibly saying that he wants to be able to drag the image around without having to require it be zoomed in, at all.

For example, in either example in the link above, without modifying the images, be able to click and drag it up/down/left/right. I imagine the 'canvas' within the bounding box would need to be possibly 9 times the size of the image itself.

| x | x | x | | x | o | x | | x | x | x |

Where 'o' is the image, and the left and right |'s are the bound, when zoomed out to 100%. dragging the item would then possible I think.

Does that make any more sense?