code: function (detach) {
                  var action = detach ? 'off' : 'on';
          
                  if (s.params.zoom) {
                      var target = s.slides;
                      var passiveListener = s.touchEvents.start === 'touchstart' && s.support.passiveListener && s.params.passiveListeners ? {passive: true, capture: false} : false;
                      // Scale image
                      if (s.support.gestures) {
                          s.slides[action]('gesturestart', s.zoom.onGestureStart, passiveListener);
                          s.slides[action]('gesturechange', s.zoom.onGestureChange, passiveListener);
                          s.slides[action]('gestureend', s.zoom.onGestureEnd, passiveListener);
                      }
                      else if (s.touchEvents.start === 'touchstart') {
                          s.slides[action](s.touchEvents.start, s.zoom.onGestureStart, passiveListener);
                          s.slides[action](s.touchEvents.move, s.zoom.onGestureChange, passiveListener);
                          s.slides[action](s.touchEvents.end, s.zoom.onGestureEnd, passiveListener);
                      }
          
                      // Move image
                      s[action]('touchStart', s.zoom.onTouchStart);
                      s.slides.each(function (index, slide){
                          if ($(slide).find('.' + s.params.zoomContainerClass).length > 0) {
                              $(slide)[action](s.touchEvents.move, s.zoom.onTouchMove);
                          }
                      });
                      s[action]('touchEnd', s.zoom.onTouchEnd);
          
                      // Scale Out
                      s[action]('transitionEnd', s.zoom.onTransitionEnd);
                      if (s.params.zoomToggle) {
                          s.on('doubleTap', s.zoom.toggleZoom);
                      }
                  }
              }
docs: Attach/Detach Events