JQuery image scaling plug-in-smartZoom, jquery-smartzoom
E-smart-zoom-jquery.js plug-in, and example: https://github.com/e-smartdev/smartJQueryZoom
Plug-in description: hover the mouse over the image and scroll the scroll wheel to zoom in or out the image.
Use smartZoom
For example, run the following code:
<!DOCTYPE html>
You can directly use the smartZoom method on the img object.
View results:
Zoom
Perfect, Which is used successfully.
However, many people may encounter the problem of using the smartZoom Image Location offset. The effect is as follows:
The border is missing. You can see the following code:
It turned out to be top and left. In this caseKey IssuesA div container is nested outside the img image. As follows:
<div class="imgDiv"> </div>
In this case, the location offset problem can be solved.
Other APIs:
// You can set top, left, and other parameters to specify the initial image parameters; $ (". imgCon img "). smartZoom ({'left': '50px '}) // cancel the zoom by inputting 'deststroy'. $ (". imgCon img "). smartZoom ('deststroy ')