Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove the scroll when the lightbox is opened. #4332

Merged
merged 1 commit into from Feb 27, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 6 additions & 2 deletions js/foundation/foundation.clearing.js
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