Disappearance of mobile menu in Bootstrap upon toggling

Working on integrating my Umbraco site with Bootstrap, and I have a partial view that includes a navigation menu. Everything seems to be functioning as expected except for the navbar.

The issue is that when you click on the button to expand it, it immediately snaps back up. Toggling it again makes it almost 'pop into existence' before moving back up to close. Here is the full output of the DOM:

<html class="gr__localhost"><head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <title></title>
    <link rel="stylesheet" href="/css/master_styles.css">
<style>@media print {#ghostery-purple-box {display:none !important}}</style></head>
<body data-gr-c-s-loaded="true">
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">Navbar</a>
  <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="navbar-collapse collapse" id="navbarNav" aria-expanded="false" style="height: 0px;">
    <ul class="navbar-nav">
      <li class="nav-item active">
        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Features</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Pricing</a>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>
    </ul>
  </div>
</nav>



    <div class="container">
        <div class="row">
            <div class="col-12">
                <h1>Pumpkin's Blog</h1>
                <p>Welcome to my blog. I'm always posting things like</p>
<ul>
<li>Photos</li>
<li>Videos</li>
<li>Arts and Crafts</li>
<li>Structural Cardboard Architecture&nbsp;</li>
</ul>
<p>I hope you stick around and comment.&nbsp;</p>
            </div>
        </div>
    </div>
    <div id="footer">
        Copyright 2018
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>

<script id="wappalyzer" src="chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/inject.js"></script></body></html>

Answer №1

It seems like you're mixing Bootstrap 3.3.7 JS with Bootstrap 4 CSS!

<html class="gr__localhost"><head>
    <!-- Required meta tags -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" integrity="sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm" crossorigin="anonymous">

    <title>Pumpkin's Blog - Meow</title>
    <link rel="stylesheet" href="/css/master_styles.css">
<style>@media print {#ghostery-purple-box {display:none !important}}</style></head>
<body data-gr-c-s-loaded="true">
    <nav class="navbar navbar-expand-lg navbar-light bg-light">
  <a class="navbar-brand" href="#">Navbar</a>
  <button class="navbar-toggler collapsed" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <div class="navbar-collapse collapse" id="navbarNav" aria-expanded="false" style="height: 0px;">
    <ul class="navbar-nav">
      <li class="nav-item active">
        <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Features</a>
      </li>
      <li class="nav-item">
        <a class="nav-link" href="#">Pricing</a>
      </li>
      <li class="nav-item">
        <a class="nav-link disabled" href="#">Disabled</a>
      </li>
    </ul>
  </div>
</nav>



    <div class="container">
        <div class="row">
            <div class="col-12">
                <h1>Pumpkin's Blog</h1>
                <p>Hi! I'm Pumpkin. Welcome to my blog. I'm always posting things like</p>
<ul>
<li>Photos</li>
<li>Videos</li>
<li>Arts and Crafts</li>
<li>Structural Cardboard Architecture&nbsp;</li>
</ul>
<p>I hope you stick around and comment.&nbsp;</p>
            </div>
        </div>
    </div>
    <div id="footer">
        Copyright 2018
    </div>
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js" integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl" crossorigin="anonymous"></script>

<script id="wappalyzer" src="chrome-extension://gppongmhjkpfnbhagpmjfkannfbllamg/js/inject.js"></script></body></html>

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

Dividing the screen into multiple sections to display cards

I have a question about integrating product cards into a split screen layout. Despite my efforts, the cards are stacking on top of each other instead of appearing side-by-side. Does anyone have a solution or suggestion? Below is the code I have been work ...

Redirect to the homepage using HTML, CSS, and JavaScript by modifying the pathname

I have my own code editor called , developed using HTML/CSS/JS only. Currently, I am working on adding a new feature similar to what is offered by . The new feature involves redirecting users who visit to a randomly generated code along with the domain ...

what methods do you use to recall codes?

Hey there! I've recently started diving into the world of HTML, CSS, and Php. I'm curious, how exactly do experienced coders manage to remember so many functions? Is it something that comes with time and practice? As a beginner myself, this quest ...

What is the best way to position the arrow next to the header of a sorted table?

I've been working with a table and wanted to enable sorting on all table headers, so I decided to refer to the bootstrap example for guidance. The issue I encountered in this example is that the arrow indicating sort direction appears on the left sid ...

Is it possible to specify the input language for a textbox or textarea in a web form?

I am currently working on developing a website in Urdu language, with features similar to that of a blogging platform. To ensure that all posts are written only in Urdu, I am exploring different options. One idea I have is to use a Javascript code that ca ...

The select materialize suddenly displayed a double arrow icon

I'm currently using Materialize for my form page, but I've encountered an issue. I can't seem to figure out how the double arrow appeared on the select dropdown (refer to the photo I've attached). Is there a way to have just one arrow i ...

Customize Individual Rows in a React DataGrid

I am exploring the world of Material UI React data grid for the first time, and I am looking to add a unique background color to only the initial three rows. Each row should have a different color scheme that remains static, without any interactions trigge ...

How about utilizing node.js as a peer for WebRTC?

Are there any available modules for utilizing node.js as a peer in WebRTC? I am interested in using WebRTC in a client/server manner rather than P2P for its ability to send packets unreliably (i.e. avoiding the delay caused by TCP's guarantee of packe ...

Prevent the input from escaping the container

I am facing an issue with my form where I want the input field to expand only up to the end of the container div, but it seems to extend beyond due to the length of the pre-input text. .container { width: 70%; } .input-field { display: inline-block; ...

Eliminating the excessive space underneath the collapsible section when it is expanded

I am facing an issue with a hidden html table inside a collapsible element. Whenever the collapsible is expanded, there seems to be a substantial gap below the table. I'm unable to identify the cause of this problem. Below, you will find images and a ...

translating creates vacant spaces on both sides

I am working with a <div class="scrollable"> that has the CSS property overflow: scroll;. Additionally, I have another <div class="line1"></div> which should not trigger any scrolling on the <div class="scrolla ...

What is the best way to manipulate a CSS animation using JavaScript within a Vue JS project?

I am facing some challenges with implementing a JavaScript function to access a CSS animation. My objective in this code is to make the border spin when the next or previous button is clicked, but I'm struggling to activate the CSS animation. Here is ...

make sure to reload the page when utilizing the ajax function

My goal is to submit a form using jQuery AJAX. Below is the code I am using, but when I trigger the ajax function, it reloads the page and redirects me to the 'registerphp.php' page. The echo messages from the 'registerphp.php' page are ...

CSS responsive design: concealing elements does not prevent the page from being displayed

Imagine a scenario where I need to display a template in two different versions based on the user's device. For instance, I have utilized the following code: <div class="desktop"> <body> Hi Desktop user </body> </div> ...

The changeover of the material is malfunctioning

Can anyone help troubleshoot the issue in this code? When I click on the navbar menu, the content is supposed to move right with a delay of 0.7s, similar to how the sidebar opens with a delay of 0.7s. However, it's not working as expected. I suspect i ...

How can you vertically center text without using table-cell and line-height?

I have a webpage at this link and I am trying to vertically align the text. Using table-cell causes all items to display in the same row, which is not what I want as shown in the image at this link. Setting a fixed line-height won't work either since ...

Best Practices for Implementing the 960 CSS Clear Class

I'm puzzled by the necessity of using the clear class in the 960 css framework. Every time I remove a div with the clear class, everything seems to function properly. Can you explain to me the significance and purpose behind this class? ...

Refresh the Dom following an Ajax request (issue with .on input not functioning)

I have multiple text inputs that are generated dynamically via a MySQL query. On the bottom of my page, I have some Javascript code that needed to be triggered using window.load instead of document.ready because the latter was not functioning properly. & ...

The fullscreen button in Photoswipe is not showing up on mobile devices

After following the instructions from this link, I successfully integrated photoswipe into my website. However, I'm facing an issue where the fullscreen button is not visible on mobile devices, even though it appears on the demo website. Here are so ...

The table is not being queried for alphabet letters

I'm having an issue with my table that has a column called BarcodeID. The numerical values work fine and I get the correct output, but when it comes to alphabet letters, it's not working as expected. I keep getting an error message: Unknown co ...