Bug in ZURB Foundation Topbar causes incorrect highlighting of links on mobile when clicked

While utilizing the ZURB Foundation Topbar, I have encountered a bug that I find frustrating. When navigating the 2nd level drop downs and clicking on a link (li elements), the active highlight flickers to one of the elements above before taking you to the page you clicked on.

---[The reason for this flickering is because the 1st level dropdown is being selected first, causing it to briefly switch to the previous level drop down and then back to the 2nd level choice]---Unfortunately, I still have no idea how to fix this issue.

   <!-- Nav Section Mobile-->
   <div class="top-bar-container hide-for-large-up">
   <nav class="top-bar">
   <ul class="title-area">
      <li class="name"></li>
      <li class="toggle-topbar menu-icon"><a href="#"><span>Menu</span></a></li>
   </ul>
<section class="top-bar-section"> 
<!-- Nav Section -->
 <ul class="">
    <li class="divider hide-for-small"></li>
    <li class=""><a title="" href="/page.html">page</a></li>
    <li class="divider hide-for-small"></li>
    <li class=""><a title="" href="/page.html">page</a></li>
    <li class="divider hide-for-small"></li>
    <li class=""><a title="" href="/page.html">page</a></li>
    <li class="divider hide-for-small"></li>

    <li class="has-dropdown"><a href="#">pages</a>
      <ul class="dropdown">
        <li class="divider hide-for-small"></li>
        <li><a href="/page.html" >page</a></li>
        <li><a href="/page.html" >page</a></li>
        <li><a href="/page.html">page</a></li>
        <li><a href="/page.html">page</a></li>
        <li><a href="/page.html">page</a></li>
        <li><a href="/page.html">page</a></li>
      </ul>
    <li class="divider hide-for-small"></li>
    <li class="has-dropdown"><a href="#">More</a>
      <ul class="dropdown">
        <li class="divider hide-for-small"></li>
        <li><a href="/page.html">page</a></li>
        <li><a href="/page.html">page</a></li>
        <li><a href="/page.html">page</a></li>
      </ul>
    <li class="divider hide-for-small"></li>
  </ul>
</section>
  </nav>
</div> 

Answer №1

In Foundation 4, there is a known issue caused by using a pseudo-class with a colon :. The correct syntax should have a period . after the li:

.top-bar-section ul li:hover > a {

The corrected version should be:

.top-bar-section ul li.hover > a {

This adjustment should resolve 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

Having difficulty with CSS animation and background issues

I can't seem to get my rotating background to work using CSS keyframe animation. I've tried different things but can't figure out what's going wrong. Below is my code: .main-header { width: 100%; Height: 128px; } .main-header, ...

Tips for making a div with a single triangular side using Reactjs

Hey there, I'm looking to design a header similar to the one shown in this image. Can someone provide guidance on how I can achieve this UI using React.js? ...

The content will be visible when the masonry element is in the active state

I have been working on creating a unique image gallery effect using Masonry layout where the images start at 0.2 opacity and change to full opacity of 1 when hovered over. Additionally, I want each image to fade to 0.7 opacity with text "Petra, Jordan" app ...

Conceal the second click action within the anchor tag

Is there a way to hide the second click event on all anchor tags except those that trigger popupfun? I have a sample page set up. [Check out the JS Fiddle here][1] http://jsfiddle.net/ananth3087/LgLnpvf4/15/ Link Anchor Tags: The page includes two ...

When you hover over it, the text moves above the background content

I am looking to enhance my table by having the text expand and hover over the content with a white background. I have achieved the expand effect, but I am struggling to get the overflow to work properly. You can view the code in action on JsFiddle: JsFiddl ...

Disabled text selection in Internet Explorer

I am in need of making one HTML element (Label) unselectable for IE. I have tried using the following methods: Unselectable=on onselectreturn=false; Unfortunately, none of these solutions are working for me. For Firefox and Chrome, I've successful ...

What is the reason for the countdown number's color remaining the same even after it reaches a specific time threshold?

Creating a simple countdown for sports was my idea, but now I'm stuck on the "changeColor" part that I don't have enough knowledge about. The countdown is functioning perfectly, but customizing the colors and adding CSS animations seems challeng ...

Tips for saving an HTML image with a unique source format (blob)

As I examine the element, the src displayed for the img is an incredibly long string that had to be significantly shortened for it to fit here. data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAyAAAAMgCAYAAADbcAZoAAAAAXNSR... However, when I extract the src ...

Having an issue with deleting a table row using jQuery when the button is clicked

I am facing an issue where clicking on a button does not delete the table row despite both the tr id and button id having the same value. Can someone please guide me on what might be going wrong? <tr id="<?php echo $result->id;?>"> <t ...

When creating a FlipCard, you may encounter the error message "The object may be null" while using the document.querySelector() method

Having trouble creating a flipcard on Next.js with tsx. The querySelector('.cardflipper') doesn't seem to locate the object and I keep getting this error: "Possibly the object is null". Does anyone know a solution to help my method recognize ...

Addressing the spacing and alignment issues within the progress bar

I need some help with my Angular app. I am currently working on creating a progress bar, but I am facing some issues with the alignment of the bars. Here is the code snippet that I have used: CSS: .progressbar { position: relative; height: 56px; mar ...

What is the process for extracting the value of a checkbox generated through JavaScript?

I recently came across a helpful post on Stack Overflow that provided sample code demonstrating how to display multiple list of checkboxes dynamically on a dropdown list. The function in the code was exactly what I needed for my webpage. However, I encount ...

Changing the border color of a Material UI textbox is overriding the default style

Upon the initial page load, I expected the border color of the text box to be red. However, it appeared grey instead. I tried setting the border color to red for all classes but the issue persisted. Even after making changes, the border color remained unch ...

Submission of a form through a dropdown menu

This dropdown form is not functioning properly when I try to submit it. Here is the code: <form name="subselect"> <select name="menu"> <option selected="selected" value="javascript:void(0)">Se ...

Transferring the value stored in the value attribute to a different PHP page?

I am attempting to pass the value from the value attribute in button using a form with the method POST to "landlord_home.php". However, when I click on the button to navigate to the next page "edit_post.php", it triggers the PHP validation code on that pag ...

MySQL unable to access information entered into form

After creating a new log in / register template using CSS3 and HTML, I now have a more visually appealing form compared to the basic one I had before. To achieve this look, I referenced the following tutorial: http://www.script-tutorials.com/css 3-modal-po ...

What is the best way to combine two menu plugins in Wordpress?

Currently, I am in the process of creating a logo with a drop down menu for my website, which can be found at . After discovering a widget called Menu Image that successfully transformed a menu item into a photo, I decided to add another widget called Ma ...

Fixed position halting in a specific area

I have a fiddle where the black box is fixed on the page, but it overlaps the map when scrolling. I want to stop the black box from overlapping the map. How can I achieve this? CSS: .item{ background:#eee; padding:10px; width:50%; margin-bottom:15px;} .n ...

Ensure that columns are neatly arranged horizontally when they do not all fit in one row

I currently have a row with 6 columns, but when they can't fit next to each other on the screen, 2 of them get pushed below, resulting in a messy layout. I could use a media query to solve this issue, however, I am curious if there is a better way to ...

Steps for organizing a list based on the number of clicks

I've created an HTML list with images of political party logos. Each logo is a grid item that can be clicked on. I want to sort the list based on the number of clicks each logo receives, essentially ranking them by popularity. However, I'm not su ...