Floating and scrolling navigation bar not functioning properly in bootstrap framework

I've been dabbling in coding for a while now, practicing at my current job. I managed to create a floating and scrolling navigation bar on the right side of my website using bootstrap. However, after taking a 3-week break and returning to my site, I noticed that the navigation bar had suddenly stopped working (without any code changes). I've looked through the code multiple times but couldn't pinpoint why it broke. Any thoughts or suggestions?

Here is an older image of the website with the functioning right-hand navigation bar. The bar used to change color while scrolling and always stayed on the right side of the page (floated).

Edit: This is how the broken right bar currently looks (aligned along the top of the screen without floating or scrolling)

Edit 2: Upon further inspection, I found that everything works fine in Microsoft Edge and Internet Explorer 10, but there seems to be an issue in Google Chrome (I couldn't test other browsers).

Stylesheet Code

.rightjump {
    margin: 0;
    padding: 10px 10px 0px 0px;
    list-style-type: none;
    width: 180px;
    position: fixed;
    overflow: auto;
    display: contents;
    right: 0;
}

.rightjumplist {
    display: block;
    background-color: greenyellow;
    padding: 8px 8px;
    text-decoration: none;
    color: black;
    text-align: center;
    border-bottom: 1px solid black;
    border-radius: 5px 40px 5px 40px;
}

.rightjumplist:hover {
    background-color: lightgray;
    color: black;
}

.activelist.active {
    background-color: forestgreen;
    color: black;
}

Main HTML Code:

<!DOCTYPE HTML>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<html>
<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
<link rel="icon" href="images/logo-small.png">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<title></title>
</head>
<body data-spy="scroll" data-target="#myScrollspy" data-offset="50">

    <!--#Floating verticle contents bar-->
    <nav>
        <ul class="leftcontents">
            <li class="leftcontentslist" style="background-color: lightgray"><img src=images/logo-large.png width="155px" height="155px"></li>
            <li class="leftcontentslist"><a id="a01" href="home.html">Home</a></li>
            <li class="leftcontentslist"><a id="a01" href="horizon1.html">New Horizon 1</a></li>
            <li class="leftcontentslist"><a id="a01" href="horizon2.html">New Horizon 2</a></li>
            <li class="leftcontentslist"><a id="a01" href="horizon3.html">New Horizon 3</a></li>
            <li class="leftcontentslist"><a id="a01" href="try1.html">We Try 1</a></li>
            <li class="leftcontentslist"><a id="a01" href="try2.html">We Try 2</a></li>
            <li class="leftcontentslist"><a id="a01" href="can1.html">We Can 1</a></li>
            <li class="leftcontentslist"><a id="a01" href="can2.html">We Can 2</a></li>
        </ul>
    </nav>
    <!--#Floating verticle jump bar (right)-->
    <nav class="navbar navbar-inverse" id="myScrollspy">
        <ul id="navbar" class="rightjump nav nav-pills nav-stacked">
            <li class="active activelist rightjumplist"><a id="a01" href="#Top">Top</a></li>
            <li class="active activelist rightjumplist"><a id="a01" href="#Bingo">Bingo</a></li>
            <li class="active activelist rightjumplist"><a id="a01" href="#Wordsearch">Wordsearch</a></li>
            <li class="active activelist rightjumplist"><a id="a01" href="#PDF1">Activity</a></li>
            <li class="active activelist rightjumplist"><a id="a01" href="#PDF2">Activity 2</a></li>
        </ul>
    </nav>


</html>

If there are any inaccuracies, please forgive me as this is my first time posting here. Thank you for your assistance! ^^

Answer №1

Upon initial inspection, it appears that the display setting on your "rightjump" element is not configured correctly. The current state is as follows:

.rightjump {
margin: 0;
padding: 10px 10px 0px 0px;
list-style-type: none;
width: 180px;
position: fixed;
overflow: auto;
display: contents;
right: 0;
}

The desired configuration should be:

.rightjump {
margin: 0;
padding: 10px 10px 0px 0px;
list-style-type: none;
width: 180px;
position: fixed;
overflow: auto;
display: block;
right: 0;
}

Please note that the change made here was from display:contents to display:block. Hope this resolves the issue!

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

To emphasize code in an HTML document, you can use the <font color="#xxx"> tag

Can anyone guide me on how to add color highlights to my HTML code in this way? <font color="#1773cc">#include </font><font color="#4a6f8b">&lt;NTL/ZZ.h&gt;</font><br> <br> <font color=&quo ...

The min-height property in CSS appears to be ineffective on Jelly Bean

In my current project developing an Android application, I have incorporated Webviews in certain activities and fragments. However, I encountered a perplexing issue when running the app on Jelly Bean (api 16 and 18) emulator - the css property min-height ...

Implementing onMouseEnter and onMouseLeave functionalities for music player

Currently facing a challenge while developing a music player app. I am trying to implement a feature where: Upon hovering over a song, a "play" button should appear in place of the song number. The currently playing song should display a "pause" ...

Accessing data in JSON format from a URL

I'm working on a website that analyzes data from the game Overwatch. There's this link () that, when visited, displays text in JSON format. Is there a way to use JavaScript to read this data and display it nicely within a <p> tag on my si ...

Troubleshooting Floating Divs in ExtJs TreePanel Component

I am currently utilizing the treepanel object in ExtJs and I am trying to implement two divs side by side within the treepanel items. Is it feasible to have one of them set with a fluid width and the other with an auto width? Despite my HTML and CSS codes ...

What is the best way to automatically hide the Materialize CSS mobile navbar?

Recently, I completed a website called Link. Using only Materialize CSS, Vanilla JS, and plain CSS, I developed a single-page application that effectively hides and reveals different sections based on event listeners. Everything functions smoothly except ...

"Bringing the power of JavaScript to your WordPress

I have set up a wordpress page and integrated some JavaScript into it. When working in wordpress, there are two tabs on a page where you can input text - 'Visual' and 'Text'. The 'Text' tab is used for adding HTML and scripts ...

Retrieve the output of a function that was invoked by the getJSON method

In the scenario where $.getJSON() successfully retrieves JSON data, a designated function is executed. Is there a way for me to capture the value returned by this function as output? $.getJSON(url, function(data) { // Perform operations with data u ...

Jquery cannot be used to set a value for an ASP .net hidden field

Having trouble setting the value of a hidden field using jQuery in ASP .NET. The hidden field is defined as follows: <asp:HiddenField runat="server" ID="hdnSelectedTicket" /> This is how I am attempting to set the value: alert(ticketI ...

html interactive/expandable tree

I've come across this code which generates an HTML tree, but I'm facing an issue where the tree expands every time I refresh the page. What I want to achieve is to have certain branches expanded and others collapsed when the page is opened, depe ...

Adjustable table region in PHP

I need help with displaying multiple results in a dynamically created table within my program. Even though I want to show around 25 records, the program cuts off after the 5th record, leaving empty space. The issue seems to be that the area does not expand ...

Ways to extract the source code of a webpage that has been modified on load

While working on extracting data from a website (completely within legal boundaries), I encountered an interesting situation. This particular site has 5 questions with answers on each page. However, upon inspecting the source code by pressing Ctrl+U, I no ...

Modify table row background color using PHP based on its position in the table with the use of a function

I am having trouble formatting my table to highlight different rows in distinct colors. The top row should be one color, the second row another, and the bottom two rows a different color each. This is to represent winners, teams getting promoted, and tho ...

What is the best way to pass a variable within a jQuery event map?

Consider the below jQuery .on() event map: $('header').on({ mouseenter: function(e) {}, mouseleave: function(e) {}, }, 'li'); Is there a way to share a common var $this = $(this) variable between the mouseenter and mouseleave even ...

Tips on how to personalize the print layout of an Angular 4 page when pressing ctrl+p

I am working on an angular4 app and I encountered an issue when trying to customize the print page view by pressing ctrl+p in the browser. The page that needs to be printed contains only Angular components, and my attempts to modify the print view using ...

A method for merging the values of three text fields and submitting them to a hidden text field

<label class="textRight label95 select205">Cost Center: </label> <input type="hidden" name="label_0" value="Cost Center" /> <input type="text" name="value_0" class="input64 inputTxtGray" value="" maxlength="10" /> <input type=" ...

Javascript functions fail to execute as intended

I have a project called calc, which includes various functions such as init. Within this project, there are three buttons that I am adding to the div using jquery. When a user clicks on any of these buttons, it should trigger the inputs function. Based on ...

Utilize Jquery to trigger Controller Action

My goal is to refresh a specific 'div' when a user adds an item to the shopping cart. I have some jQuery code that should execute on the click event. It should trigger a post action (which is functioning correctly) and then reload everything with ...

Discovering the method to extract text from an element within a search result with Selenium Webdriver

Struggling to extract a URL from Tripadvisor.com's search results using its element, my attempts have proven futile so far. Check out the code snippet below: from selenium.webdriver.common.keys import Keys from selenium import webdriver from seleniu ...