worka / vanilla-js-wheel-zoom

Image resizing using mouse wheel (pinch to zoom) + drag scrollable image (as well as any HTML content)
https://worka.github.io/vanilla-js-wheel-zoom
MIT License
160 stars 30 forks source link

Great, but does not work well on scaled page #3

Closed wilschut closed 4 years ago

wilschut commented 4 years ago

If a visitor has it's browser to scale 200% or so, the popup does not open with the full image in view. And you can't get it completely in sight. Can this be helped ?

worka commented 4 years ago

Hi, @wilschut. Sorry, I can`t understand what you mean

wilschut commented 4 years ago

Well, when browsing, you can scale the fonts in a website with [ctrl]+ mouse-wheel. This way you can set it to 150% or so. But if you open the popup then, the picture does not show up completely: only the upper half and you vcan not get it totally in screen. examp

wilschut commented 4 years ago

I zoomed in to 300% here...

wilschut commented 4 years ago

Nice of you to respond by the way. It's a cool script.

worka commented 4 years ago

"wheel-zoom" doesn't work there at all (in popup), or maybe your physical container size for image is larger than popup size?

worka commented 4 years ago

If you can then upload the code to the server, I'll try to see what’s the matter (I mean this http://btwilschut.nl/web/piepframeset.htm?piepstart.htm)

wilschut commented 4 years ago

I changed the url: http://btwilschut.nl/web/gosstart.htm But I think it's not your code that is the problem. I should not have raised the issue. Sorry for that. I got it reasonably to work. Can I use your code in my (a little bit) commercial software for family trees ? It shows lists of thumbnails, and a click on them opens a popup with your wheelzoom control.

wilschut commented 4 years ago

see http://btwilschut.nl/web/gos000000.htm#1

worka commented 4 years ago

It works fine on your site for me even when scaling 300%+ (latest version Chrome)

Why you don`t use modern "popup methods" such as fancybox or similar (without jQuery), instead native browser popup window?

wilschut commented 4 years ago

Yes, I got it to work fine now. The tool I make is a winforms application that produces simple static websites that must work on all environments and servers and in all browsers, So I try to keep it as simple and old-school as possible. And this is only a really small item in the application so I can't spend much time on it. Especially gettings things to work correctly on firefox is a challenge. But I'm not clear on wheather or not I can use your code. I put your name and url in the .js script. Is that ok ?

worka commented 4 years ago

Ok, no problem.