Skip to content

Commit

Permalink
Remove the scroll when the lightbox is opened.
Browse files Browse the repository at this point in the history
  • Loading branch information
imagentleman committed Feb 4, 2014
1 parent 7ea2e8d commit 58bdb95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions js/foundation/foundation.clearing.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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();
Expand All @@ -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;
Expand Down

0 comments on commit 58bdb95

Please sign in to comment.