From 58bdb953471535c0b2e2d5df4639eebc1bfe9fbe Mon Sep 17 00:00:00 2001 From: imagentleman Date: Mon, 3 Feb 2014 23:59:22 -0500 Subject: [PATCH] Remove the scroll when the lightbox is opened. --- js/foundation/foundation.clearing.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/js/foundation/foundation.clearing.js b/js/foundation/foundation.clearing.js index d2c892eef8..58ea17ae74 100644 --- a/js/foundation/foundation.clearing.js +++ b/js/foundation/foundation.clearing.js @@ -154,7 +154,8 @@ }, open : function ($image, current, target) { - var root = target.closest('.clearing-assembled'), + var body = $(document.body), + root = target.closest('.clearing-assembled'), container = $('div', root).first(), visible_image = $('.visible-img', container), image = $('img', visible_image).not($image); @@ -168,6 +169,7 @@ this.loaded(image, function () { image.css('visibility', 'visible'); // toggle the gallery + body.css('overflow', 'hidden'); root.addClass('clearing-blackout'); container.addClass('clearing-container'); visible_image.show(); @@ -191,9 +193,11 @@ } else { return target.closest('.clearing-blackout'); } - }($(el))), container, visible_image; + }($(el))), + body = $(document.body), container, visible_image; if (el === e.target && root) { + body.css('overflow', ''); container = $('div', root).first(); visible_image = $('.visible-img', container); this.settings.prev_index = 0;