I am using brandonaaron jquery-mousewheel plugin in
https://github.com/brandonaaron/jquery-mousewheel
with a zoom function on Pan Zoom.
The problem is i cant fix a maximum value to infinely scroll down and scroll up. How can i fix this problem.
I have tried it simple function but i cant able to make mouse wheel here
var zoomLevel = 100;
var maxZoomLevel = 105;
var minZoomLevel = 95;
function zoom(zm) {
var img=document.getElementById("pic");
if(zm > 1){
if(zoomLevel < maxZoomLevel){
zoomLevel++;
}else{
return;
}
}else if(zm < 1){
if(zoomLevel > minZoomLevel){
zoomLevel--;
}else{
return;
}
}
wid = img.width;
ht = img.height;
img.style.width = (wid*zm)+"px";
img.style.height = (ht*zm)+"px";
img.style.marginLeft = -(img.width/2) + "px";
img.style.marginTop = -(img.height/2) + "px";
}
How to give maximum value and minimum value in mousewheel function