From eb6f0a8124826ec493f2bf02e4fe293fa3c6ad62 Mon Sep 17 00:00:00 2001 From: pavanskipo Date: Fri, 2 Oct 2020 18:40:28 +0530 Subject: [PATCH] Added disableZoom property --- README.md | 1 + src/valiant.jquery.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/README.md b/README.md index 2db2962..9b52806 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,7 @@ More detailed api documentation pending, for now the below explains about all yo $('.valiantContainer').Valiant360({ crossOrigin: 'anonymous', // valid keywords: 'anonymous' or 'use-credentials' clickAndDrag: false, // use click-and-drag camera controls + disableZoom: false // disable zooming on the video keyboardControls: true, // use keyboard controls (move by arrows) flatProjection: false, // map image to appear flat (often more distorted) fov: 35, // initial field of view diff --git a/src/valiant.jquery.js b/src/valiant.jquery.js index 980f5b2..e12fc71 100644 --- a/src/valiant.jquery.js +++ b/src/valiant.jquery.js @@ -48,6 +48,7 @@ three.js r65 or higher defaults = { crossOrigin: 'anonymous', clickAndDrag: false, + disableZoom: false, keyboardControls: true, fov: 35, fovMin: 3, @@ -458,6 +459,10 @@ three.js r65 or higher var wheelSpeed = -0.01; + if(this.options.disableZoom) { + return; + } + // WebKit if ( event.wheelDeltaY ) { this._fov -= event.wheelDeltaY * wheelSpeed;