function zoom(e) {
      e.preventDefault();
      e.stopImmediatePropagation();

      const imgPos = document.getElementById(masterID+ 'Image').getBoundingClientRect();
      const height = Number(elem.style.height.slice(0, -2));
      const width = Number(elem.style.width.slice(0, -2));

      let resultWidth;
      let resultHeight;

      let coef;
      if(e.deltaY > 0) {
         coef = (width - ZOOM_SPEED)/width;
      } else {
         coef = (width + ZOOM_SPEED)/width;
      }

      resultHeight = height * coef;
      resultWidth = width * coef;

      // Width too small
      if(imgPos.width/10 > resultWidth) {
         resultWidth = imgPos.width/10;
      }

      // Height too small
      if(imgPos.height/10 > resultHeight) {
         resultHeight = imgPos.height/10
      }

      if(elem.id.endsWith('Lens')) {

         // Height too big
         if(resultHeight > imgPos.height) {
            resultHeight = imgPos.height;
         }

         // Width too big
         if(resultWidth > imgPos.width) {
            resultWidth = imgPos.width;
         }
      }
      else {
         // Height too big
         if(resultHeight > window.innerHeight) {
            resultHeight = window.innerHeight;
            resultWidth = window.innerHeight * (imgPos.width/imgPos.height);
         }

         // Width too big
         if(resultWidth > window.innerWidth) {
            resultWidth = window.innerWidth;
            resultHeight = window.innerWidth * (imgPos.height/imgPos.width);
         }
      }

      elem.style.height = resultHeight + 'px';
      elem.style.width = resultWidth + 'px';

      update(masterID);
   }
/**
    * Function that allow you the change the size  an element
    *
    * @param e -- The scroll wheel event
    */
Function that allow you the change the size  an element
@param e -- The scroll wheel event
Function that allow you the change the size an element @param e -- The scroll wheel event
function zoom(e) {
      e.preventDefault();
      e.stopImmediatePropagation();
      const imgPos = document.getElementById(masterID+ 'Image').getBoundingClientRect();
      const height = Number(elem.style.height.slice(0, -2));
      const width = Number(elem.style.width.slice(0, -2));
      let resultWidth;
      let resultHeight;
      let coef;
      if(e.deltaY > 0) {
         coef = (width - ZOOM_SPEED)/width;
      } else {
         coef = (width + ZOOM_SPEED)/width;
      }
      resultHeight = height * coef;
      resultWidth = width * coef;
      if(imgPos.width/10 > resultWidth) {
         resultWidth = imgPos.width/10;
      }
      if(imgPos.height/10 > resultHeight) {
         resultHeight = imgPos.height/10
      }
      if(elem.id.endsWith('Lens')) {
         if(resultHeight > imgPos.height) {
            resultHeight = imgPos.height;
         }
         if(resultWidth > imgPos.width) {
            resultWidth = imgPos.width;
         }
      }
      else {
         if(resultHeight > window.innerHeight) {
            resultHeight = window.innerHeight;
            resultWidth = window.innerHeight * (imgPos.width/imgPos.height);
         }
         if(resultWidth > window.innerWidth) {
            resultWidth = window.innerWidth;
            resultHeight = window.innerWidth * (imgPos.height/imgPos.width);
         }
      }
      elem.style.height = resultHeight + 'px';
      elem.style.width = resultWidth + 'px';
      update(masterID);
   }
function zoom ( e ) { e . preventDefault ( ) ; e . stopImmediatePropagation ( ) ; const imgPos = document . getElementById ( masterID + 'Image' ) . getBoundingClientRect ( ) ; const height = Number ( elem . style . height . slice ( 0 , - 2 ) ) ; const width = Number ( elem . style . width . slice ( 0 , - 2 ) ) ; let resultWidth ; let resultHeight ; let coef ; if ( e . deltaY > 0 ) { coef = ( width - ZOOM_SPEED ) / width ; } else { coef = ( width + ZOOM_SPEED ) / width ; } resultHeight = height * coef ; resultWidth = width * coef ; if ( imgPos . width / 10 > resultWidth ) { resultWidth = imgPos . width / 10 ; } if ( imgPos . height / 10 > resultHeight ) { resultHeight = imgPos . height / 10 } if ( elem . id . endsWith ( 'Lens' ) ) { if ( resultHeight > imgPos . height ) { resultHeight = imgPos . height ; } if ( resultWidth > imgPos . width ) { resultWidth = imgPos . width ; } } else { if ( resultHeight > window . innerHeight ) { resultHeight = window . innerHeight ; resultWidth = window . innerHeight * ( imgPos . width / imgPos . height ) ; } if ( resultWidth > window . innerWidth ) { resultWidth = window . innerWidth ; resultHeight = window . innerWidth * ( imgPos . height / imgPos . width ) ; } } elem . style . height = resultHeight + 'px' ; elem . style . width = resultWidth + 'px' ; update ( masterID ) ; }
Function that allow you the change the size  an element
 @param e -- The scroll wheel event
Function that allow you the change the size an element @param e -- The scroll wheel event
// Width too small // Height too small // Height too big // Width too big // Height too big // Width too big