Using Brave browser hereâs my solution to slaying the red monster. Right click the evil perpetrator, go Brave > Block element by selector.
It wonât identify it, but we can kill the class which activates on scrolling up (which is also triggered by a Ctrl+F search which wraps the page!). What we put in the box is âheader.nav-downâ and refresh the page.
You could also use â.hidden-sm.hidden-xs.container-fluidâ or even â.hidden-sm.hidden-xs.container-fluid > rowâ.
Itâs not completely clean, it does kill the top banner always, and scrolling up now wipes the lot out, but scrolling down will bring back the search, language and version. If thereâs a way of preventing the event setting the nav-down class to the header that would be the way to go, not wiping out the banner completely! Or just clearing the nav-down class.
For Chrome users you just pick it for blocking with the uBlock extension.
Once done youâll need to navigate back to https://cakephp.org/ to view the banner. You may also wish to repeat this process for the API site too. All the links in the banner are also at the bottom of the page, which is handy.
Sanity restored.
Here is the offender: -
https://book.cakephp.org/4/en/_static/app.js
function hasScrolled() {
var st = $(this).scrollTop();
// Make sure they scroll more than delta
if(Math.abs(lastScrollTop - st) <= delta)
return;
// If they scrolled down and are past the navbar, add class .nav-up.
// This is necessary so you never see what is "behind" the navbar.
if (st > lastScrollTop && st > navbarHeight){
// Scroll Down
$('header').removeClass('nav-down').addClass('nav-up');
} else {
// Scroll Up
if(st + $(window).height() < $(document).height()) {
$('header').removeClass('nav-up').addClass('nav-down');
}
}
lastScrollTop = st;
}
Someone please set delta to a few billion or so, thanks
Actually, what needs changing is: -
if(st + $(window).height() < $(document).height()) {
to
if(st == 0){
whichâll restore it when back at the top of the page.
Sorry for the bump on this old topic, but as this conversation has been going on for several years on various threads I figured it wasnât going away any time soon.