when reveal is open, the background stays
when reveal is open, the background shifted incorrectly when html having height:100%;
In the foundation.reveal.js
I have
_disableScroll(){
if ($(document).height() > $(window).height()) {
var scrollTop = $(window).scrollTop();
var height = $(window).height();
$("html")
.css("top", -scrollTop);
$("html").css("height", height+scrollTop);
}
}
_enableScroll(){
if ($(document).height() > $(window).height()) {
var scrollTop = parseInt($("html").css("top"));
$("html")
.css("top", "");
$("html").css("height", "");
$(window).scrollTop(-scrollTop);
}
}
It seems get solved after I add those.
Test Case:
How to reproduce:
Hi @ash11tw. Thank you for your issue.
We just released Foundation v6.5.0-rc.1. We fixed a lot of Reveal bugs in it. Could you test it and tell if you have the same error ?
Hi, Sorry for late reply. I tried v6.5.0-rc.1. The problem existed. I think it is because _disableScroll and _enableScroll were added after v6.4.4-rc.1. I don't see those methods in v6.4.3. When set top for document, it get wrong top if you have height: 100%.
@ash11tw I have some trouble to reproduce the issue. Could you provide a CodePen ?
Hi @ncoden I have made a quick sample from issue reported in this post
https://codepen.io/angie_rd/pen/yRMPLW
I have the same problem. I'm using version [email protected]
another workaround:
Foundation.Reveal.prototype['_disableScroll'] = function() {}
@AngieRd @domschmidt Thank you, I'll take a look at it.
Another workaround (hook into open event) @ash11tw @ncoden @domschmidt
$(document)
.on("open.zf.reveal", function() {
$("html").removeClass("is-reveal-open")
});
Hi. I investigated this issue.
It comes from the way we disable the scrollbar. It works by making the whole page fixed and applying an offset on it to reproduce the scroll shift. It's a bit tricky but it's the only way we found to make this working on all browsers.
When you use height: 100% on body, its height is now relative to the viewport, much smaller than the whole page height, so if you scrolled a bit, its content overflows and is not visible.
See for example with html in black, body in white and the content in grey.

We could solve this (and others issues) by preventing the scroll on html/body without hiding their content (overflow: visible) and/or by forcing html to have the window height, like proposed in the description of this pull request.
At first I'll check if we still need this trick or if we could drop it for a more sustainable solution, according to a new browser support range.
The following should fix this:
html, body{
min-height: 100%;
max-height: 100%;
}