You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Quick & dirt draft fix for the bootstrap's navbar-fixed-top issue.
Overview
When you call a given section of a document (e.g. via <a href="#section"> or domain.com/page#section1) browsers show that section at the top of window. Bootstrap's navbar-fixed-top, _since it's fixed_, *overlays* first lines of content.
This function catches all of the <a> tags pointing to a section of the page and rewrites them to properly display content.
Works fine even if a # section is called from URL.
Usage
Paste this function wherever you want in your document and append _fixNavbarIssue()_ to your <body>'s onload attribute.
*/
if($(document).width()>768){ // Required if "viewport" content is "width=device-width, initial-scale=1.0": navbar is not fixed on lower widths.
var hash = window.location.hash;
// Code below fixes the issue if you land directly onto a page section (http://domain/page.html#section1)