Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow upscaling #33

Open
vollstock opened this issue Apr 4, 2018 · 1 comment
Open

Allow upscaling #33

vollstock opened this issue Apr 4, 2018 · 1 comment

Comments

@vollstock
Copy link

With a small change, you could let the user configure whether or not he wants to allow upscaling images or not

in line 108 add a default (false to keep normal behaviour as is):

  // default options
  var defaults = {
    time: 300,
    padding: 40,
    offset: 40,
    keyboard: true,
    cubicBezier: 'cubic-bezier(.2, 0, .1, 1)',
    background: 'rgba(255, 255, 255, .98)',
    zIndex: 2147483647,
    allowUpscaling: false
  };

And in line 260 change the if statement to this:

if (naturalWidth < viewportWidthOffset && naturalHeight < viewportHeightOffset && !config.allowUpscaling) {
//...

Thanks a lot :-)

@vollstock
Copy link
Author

I have included this because I am loading high-res images after zooming into the low-res thumbnails.
With the old behaviour, the plugin would restrict zoom to the size of the small thumbnail images.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant