Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
calibas
· 8y ago · 0 comments
What about just removing what you can't see from the DOM entirely, and load it in again when the dialog closes? Wouldn't be too hard with React or Vue. Just make it so either the page content or the modal is loaded.
Comments
[–]
TekMol
8y ago
Or just throw in a CSS rule that says 'Everything not in the modal is display: none'. You don't need React or Vue for that. Just a line of CSS.
[–]
DerJacques
8y ago
You can do that, but the visitor's scroll position would be reset, when the modal is closed.
[–]
calibas
OP
8y ago
Could save it and restore it, though that may create some other issues.