javascript - Obtaining page maximum height in Jquery -
I do not know that I am specific enough,
but I have a lightbox-style FEDIN background but I It seems that the background will not reach the bottom of the page. So when I scroll, white background is visible again.
Here's the demo:
HTML
& lt; Body & gt; & Lt; Div id = "overlay" & gt; & Lt; / Div & gt; & Lt; One style = "position: absolute;" Href = "#" class = "btn btn-default" data-toggle = "active" & gt; Button & lt; / A & gt; & Lt; Div class = "east height" & gt; & Lt; / Div & gt;
css
#overlay {position: absolute; Width: 100%; Height: 100%; Background: # 000; Top: 0; Left: 0; Opacity: 0; Transition: Opacity .3s; -Moose infection: ambiguity .3s; -WebKit-Infection: Opacity .3s; } .backdrop {Fuzzy: 0.4! Important; } .ex-height {height: 1204px; }
Jquery
$ (function () {function toggle () {$ ('# overlay'). ToggleClass ('backdrop');} $ ('[Data-toggle =' active ']'). Click (toggle);});
Thanks for any helpful advice!
Set height overlays at the height of the document:
$ ( '# Overlay'). Toggleclass ('Backdrop') Height ($ (document). High ());
Comments
Post a Comment