-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
[documentation site] Back button does not scroll the page (solution included) #6751
Comments
The only disadvantage of the above solution is that, when scrolling the left menu and reaching the end of it, the main page is scrolled. This is how the web works however. But I've a mini library for that: https://github.com/ibc/dontscrollthebody :) |
/cc @nodejs/documentation |
Should I report this issue in https://github.com/nodejs/nodejs.org instead? Note that "About this Documentation" clearly states that:
(which points to this project) |
#6641 should fix this, which I'll land shortly. |
I had a similar hack planned in #6641, but decided to not mess with the scrolling. |
Moved the sidebar to a fixed position and moved the main column to the page's body, which results in back/forward navigation through hash links and search highlight working again. Fixes: nodejs#6637 Fixes: nodejs#6751 Based on: nodejs#5716 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Lindstaedt <[email protected]>
Yes, #6641 seems to fix it. |
Moved the sidebar to a fixed position and moved the main column to the page's body, which results in back/forward navigation through hash links and search highlight working again. Fixes: #6637 Fixes: #6751 Based on: #5716 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Lindstaedt <[email protected]>
Moved the sidebar to a fixed position and moved the main column to the page's body, which results in back/forward navigation through hash links and search highlight working again. Fixes: #6637 Fixes: #6751 Based on: #5716 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Lindstaedt <[email protected]>
Moved the sidebar to a fixed position and moved the main column to the page's body, which results in back/forward navigation through hash links and search highlight working again. Fixes: #6637 Fixes: #6751 Based on: #5716 Reviewed-By: Luigi Pinca <[email protected]> Reviewed-By: Robert Lindstaedt <[email protected]>
NOTE: This happens in a computer view (big screen).
How to reproduce (at least in Chrome):
Class: http.ClientRequest
.https://nodejs.org/api/http.html#http_class_http_clientrequest
https://nodejs.org/api/http.html
again, but the page was not scrolled up.This is because
<html>
and<body>
have bothheight: 100%
(this is OK), but then there is a main container<div id="content">
which also hasheight: 100%
, and there is where the problem is:By having a container with
height: 100%
within the body, the scroll is not done on the body itself, but on the container. And unfortunately the Back button does not scroll back a div (but just the body element).The solution is to remove the
height: 100%
of the<div id="content">
(you can test it by removing such a CSS property in the browser inspector), but of course that requires changes for the left menu to remain fixed when the page is scrolled. Such a change just requires replacingposition: absolute
withposition: fixed
in the<div id="column2">
.To summarize:
<div id="content">
removeheight: 100%
.<div id="column2">
setposition: fixed
.The text was updated successfully, but these errors were encountered: