From 1535b1baafa6b0e4a0c3bc84f3e3654c259b0bea Mon Sep 17 00:00:00 2001 From: ergec Date: Fri, 11 Aug 2017 08:44:15 +0300 Subject: [PATCH] added bodyScroll option bodyScroll option lets user to keep body scrolling. Useful when clicked a button below the first screen. --- jquery.modal.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/jquery.modal.js b/jquery.modal.js index 2c3bcce..6b662b6 100644 --- a/jquery.modal.js +++ b/jquery.modal.js @@ -113,7 +113,8 @@ block: function() { this.$elm.trigger($.modal.BEFORE_BLOCK, [this._ctx()]); - this.$body.css('overflow','hidden'); + if (!this.options.bodyScroll) + this.$body.css('overflow','hidden'); this.$blocker = $('
').appendTo(this.$body); selectCurrent(); if(this.options.doFade) { @@ -130,7 +131,7 @@ this.$blocker.remove(); this.$blocker = null; selectCurrent(); - if (!$.modal.isActive()) + if (!$.modal.isActive() && !this.options.bodyScroll) this.$body.css('overflow',''); } }, @@ -211,7 +212,8 @@ showSpinner: true, showClose: true, fadeDuration: null, // Number of milliseconds the fade animation takes. - fadeDelay: 1.0 // Point during the overlay's fade-in that the modal begins to fade in (.5 = 50%, 1.5 = 150%, etc.) + fadeDelay: 1.0, // Point during the overlay's fade-in that the modal begins to fade in (.5 = 50%, 1.5 = 150%, etc.) + bodyScroll: false // Keeps body overflow visible, body scrolling enabled, is set to true. Default is false. }; // Event constants