Having trouble getting the Zurb Foundation Top-bar Dropdown and Menu to function correctly

<nav class="top-bar" data-topbar role="navigation">
  <ul class="title-area">
    <li class="name">
      <h1><a href="#">Welcome</a></h1>
    </li>
     <!-- Remove the class "menu-icon" to get rid of menu icon. Take out "Menu" to just have icon alone -->
    <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
  </ul>

  <section class="top-bar-section">
    <!-- Right Nav Section -->
    <ul class="right">
      <li class="has-dropdown">
        <a href="#">Hello, User</a>
        <ul class="dropdown">
          <li><a href="#">Settings</a></li>
          <li class="active"><a href="#">Log Out</a></li>
        </ul>
      </li>
    </ul>

  </section>
</nav>

I am encountering two issues with the navigation bar.

  1. The dropdown menu is not functioning properly in full screen mode. Clicking or hovering over 'Hello, User!' does not trigger any action. Upon inspecting the element, it seems like the drop-down is positioned at -100%.

section class="top-bar-section" style="left: -100%;

2. When I resize my screen, the menu text and icon appear, but 'Hello, User' is displayed below instead of only showing when clicking on Menu. Furthermore, clicking on the menu does not result in any action.

Your help in resolving these issues would be highly appreciated!

Answer №1

Your initial code is spot on. It seems like there might be an issue with the JQuery necessary for the dropdown functionality, or it's not triggering properly. Take a closer look at that and if the problem persists, feel free to share your full code including any head tags.

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

Can PushState be used to Ajaxify CSS files?

Currently, I am in the process of developing a basic website and have decided to incorporate the Ajaxify library for seamless page transitions. One challenge I have encountered involves the combination of global CSS files (applied throughout the entire sit ...

Resize an image to precisely match the height of the text automatically

I am facing a challenge where I want to embed an image inline with text, while ensuring that it matches the height of the text. I have tried using <img src="img.jpg" height=16> and also <img src="img.jpg" height="100%">, but the former does not ...

Issue with if statement when checking element.checked

Hey everyone, I'm currently working on a calculator app and running into an issue. I have set up 3 radio buttons and I would like to check them using an 'if statement' in my JS file. However, the problem is that the 'main' element ...

I prefer to have my side navigation bar open on desktop and laptop screens, but closed on mobile devices

I am experiencing an issue with the side navigation menu. Is there a way to have the side nav instantly open on desktop, while remaining closed on mobile phones? I have tried using the "active" class but the side nav stays closed. <!DOCTYPE html> & ...

tips on adjusting margins or paddings in option select

How can I use the margin or padding options for my select dropdown? I tried using &nbsp; <select class="select"> <option value="100"></option> <option value="250">$593</option> ...

"Showcasing MongoDB information on a webpage using Node.js and HTML

We have stored worker information in MongoDB. Now, how can we display that information on an HTML home page? Here is the code I used to save the data: //routes.js var Employee = require('../app/models/employee'); app.post("/addEmployee", (req ...

Auto language-switch on page load

Wondering if using jQuery is the best approach to create a single French page on my predominantly English website. I want it to work across multiple browsers on pageload, currently using HTML replace. jQuery(function($) { $("body").children().each(funct ...

Displaying text on top of an image with the help of jquery and

I found a tutorial on this website that I'm trying to follow. It involves creating a fading/darkening effect on image rollover with text appearing, but I can't seem to get it to work even when starting from scratch. Despite having experience wit ...

Creating dynamic images with animated text using PHP

How can I add a personal touch to my website banners for visitors? 1) Currently, only the first frame of GIF images is being displayed in the animated banners 2) I am looking to incorporate a text field where users can input their desired text. Upon form ...

What could be causing the bootstrap card alignment issue when trying to display them side by side

I am currently developing a Flask project where I'm showcasing user information retrieved from the database within bootstrap cards. Utilizing jinja2 to iterate through an object statuses {% extends "base.html" %} {% block content %} {% if ...

Dynamic CSS Locking Table Headers - Adjustable Width and Height Featuring Both Vertical and Horizontal Scroll Bars

Is it possible to use Pure CSS to lock headers in a thead element while keeping the entire table variable width and allowing for vertical and horizontal scrolling of the content? I came across this solution, but it fixes the width of the columns and the t ...

Whenever I save innerHTML to a text file, a newline break is automatically inserted in the saved text file. The same newline break also appears when I reload the page

Whenever the button is clicked, the text file saves with a line break for every p tag inside div1, not just the first one. <p>x1</p> ....linebreak If the button is clicked three times, reloaded, and then clicked again, the result is as follows ...

What is a more effective method for presenting text alongside images in a seamless manner?

I'm having trouble aligning two labels of text inline under two images. The images are floating to the right, but when I try to float the text as well, it doesn't align properly underneath them. I attempted to use a separate container for the la ...

passing a PHP variable into an HTML input field

Recently, I've encountered a problem where I need to transfer PHP variables to HTML input fields. echo $ManuellTagnavnMain; for ($n = 0; $n < 6; $n++) { print_r(++$ManuellTagnavnMain.PHP_EOL); } I'm looking for a way to pass these values ...

Transmit data between JSP pages

I have encountered a challenge where I need to pass the value of an input from login.jsp to sentUser.jsp. While there are several solutions available, the issue lies in the fact that each solution treats sentUser.jsp as the action in the form of login.jsp ...

JQuery Reveals AJAX Request with Malfunctioning HTML Markup

I have been working on parsing an XML file and displaying the output in a div. However, I've encountered an issue where the .append() function is not generating the expected HTML output. Below is the JQuery code snippet I am using: var container = $ ...

Header 1 escaping from its designated container

Encountering a problem with a h1 element not remaining within its parent div. Strangely, it remains contained until the font size of the h1 surpasses a certain threshold, causing it to spill out of the div and overlap with other content. Here is the snippe ...

Holding off on routing the pathName through the router until the next-page-transitions have been completed

In my current setup, I have two distinct elements at play. Using the code snippet below: className={router.pathname.startsWith("/pagename") ? "menu-active" : ""} I am able to apply the menu-active class to the pagename naviga ...

Circular Corners and Concealed Content: A Guide to Border-Radius and Overflow

Having an issue with border-radius and overflow: hidden together, causing a strange problem as shown in the picture. The image doesn't extend to the edge of the div at the bottom right, leaving a visible curve. Any assistance would be greatly appreci ...

choose the drop-down option that is consistently set to the first index

I am currently working on a JavaScript code that aims to fetch the selected item's value, but it seems to always point to the 0 index and return the first value. My HTML Code: <html> <head> <title>Simple Extension</title ...