jackmoore / wheelzoom

A small script for zooming IMG elements with the mousewheel/trackpad.
http://www.jacklmoore.com/wheelzoom
MIT License
342 stars 95 forks source link

Zoom value argument seems not working #21

Closed szlaci3 closed 8 years ago

szlaci3 commented 8 years ago

The only problem i found, zooming to a given value is not working for me. wheelzoom(document.querySelectorAll('img'), {zoom:0.05}); I tried values like 0.05, 0.5, 1, 2, 40. They all behave the same, adding background-size with the value of the original size of the image. And wheelzoom is applied. So these two behave the same and the zoom value is not taking effect: wheelzoom(document.querySelectorAll('img')}; wheelzoom(document.querySelectorAll('img'), {zoom:0.05});

I thought the second one is zooming in to the specified value (Max is 1 and equals the original image size), independently on mouse wheel interaction.

Even on a very simple page with one image inside body and no styling, i find the same issue.

I intended to use this in a React, jQuery, bootstrap carousel context and to add zooming buttons to toggle between different zoom levels. It would imply "destroy" and "wheelzoom" each time, which is doable, if the zoom value worked.

BTW, here they are wrong about how to use wheelzoom: https://docs.omniref.com/github/jackmoore/wheelzoom/1.1.1 $('img').wheelzoom();

Thank you

szlaci3 commented 8 years ago

I got it. Zoom value says how fast it should zoom while wheel is rolling. Sorry to bother.