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

Combination of written content and mathematical equations displayed on an HTML webpage

I've been tasked with creating something similar to the following on an HTML page: The math tag in HTML is not suitable because it struggles with handling the line break between parts "/begin()-/end()". To achieve the desired effect (succes ...

How can I reset a CSS position sticky element using JavaScript?

I have created a page where each section fills the entire screen and is styled using CSS position: sticky; to create a cool layered effect. Check it out here: https://codesandbox.io/s/ecstatic-khayyam-cgql1?fontsize=14&hidenavigation=1&theme=dark ...

Creating a Vertical Stack of Three Divs in ReactJS

Just Getting Started: As a newcomer to ReactJS and web development in general, I've put effort into researching my question without success. I acknowledge that the solution might be simpler than I think, so I apologize in advance if it turns out to b ...

How can I eliminate the outline from the modal backdrop using Material UI styling shown in the image provided?

https://i.stack.imgur.com/cBCzd.png After attempting to remove the border and box shadow, I am still encountering issues with lines appearing only when clicking on the modal body. The modal styling code has been omitted as it primarily includes flex styli ...

Adding two BR tags between inline images within a wrapper is causing inconsistencies in spacing when viewed in Firefox compared to all other browsers. Check out an example of this issue in

JS Fiddle Link http://jsfiddle.net/Xfvpu/1/ Having a perplexing issue with image rendering in Firefox compared to other browsers. The xhtml doctype is used with proper br / tag spacing, but the gap between two images on this specific document displays dif ...

Troubleshooting: Ineffective use of replace() function on input value with jQuery

Visit this link for a demo How can I update the input value based on user selection in a dropdown menu? The objective is to change the value from "service_######" to "membership##_####" when the user selects YES, but my current JavaScript code using repla ...

Trouble with CSS in a WordPress theme utilizing a two-column layout

After setting up my wordpress blog (http://raptor.hk), I encountered an issue with aligning the right sidebar correctly. It seems like I have overlooked something in the CSS code. The div responsible for the sidebar has been assigned the name "rightbar". I ...

What is the best way to modify a CSS property using logical operators in JQuery?

If an element with the class ".has_padding" does not have any text content, it should be set to "display:none;". However, those elements with text inside should remain visible. Below is some code where I have styled the elements to demonstrate the issue. ...

Eliminating extra space below the footer using CSS in Wordpress site

After recently updating my website, I am struggling with some of the finer points. It's worth noting that I lack experience in web development, despite working in the software field; I am trying to broaden my knowledge. In particular, I have noticed ...

Error message "Undefined is not a function" occurred while using jQuery's .replace and scrollTop functions

I'm having issues with the scroll function in my code. It doesn't seem to be able to locate the ids in my HTML, even though I can't figure out why. I had a previous version that worked perfectly fine (unfortunately, I didn't save it D:) ...

Find the dominant color within the project's style sheets

Is there a method to extract the main color from an angular material theme and apply it in the css files of an angular project? Within a project, we can specify the primary color in a *.scss document as shown below: @import '~@angular/material/themi ...

The width of table cells within a div is completely disregarded

The cell width property seems to be ignored in this situation. Despite trying numerous approaches, the cells are splitting into equal portions and not respecting the specified width. Inspecting the code did not reveal any unexpected inheritance that could ...

What is the best way to apply a png overlay to each img tag when hovered over?

Here is the code snippet I am working with: <div class="latest-post"> <a href="http://localhost/blaze/2011/documentaries/test-big-thumb" rel="bookmark"> <span> <img width="140" height="100" src="http:// ...

Developing a customizable datepicker with the ability to select specific months or date ranges

I am currently developing a WebApp using flask and constructing templates in HTML/JS for the front end. I am in need of a datepicker that will provide the user with the option to choose a specific date range or select a range of months. Take a look at the ...

unexpected issue when trying to append a child element after creating its innerHTML

Upon executing this script, I expect to see the initially empty div with id="checkboxes" transformed into: <div id="checkboxes"> <label><input type="checkbox">option1</label> <label><input type="checkbox">opt ...

ng-view is the culprit behind the website's fatal error

Encountering a "RangeError: Maximum call stack size exceeded" in the console while trying to recreate a basic routing example from w3schools. The crash seems to be linked to <div ng-view></div> in index.html. Despite making minimal changes from ...

Strange occurrences within the realm of javascript animations

The slider works smoothly up until slide 20 and then it suddenly starts cycling through all the slides again before landing on the correct one. Any insights into why this is happening would be greatly appreciated. This issue is occurring with the wp-coda- ...

Using BeautifulSoup4 in Python to extract text data from a nested tag within an h1 element

Seeking assistance in extracting the text content within an anchor tag that is nested inside a heading tag. <h1 class="branded-page-header-title"> <span class="qualified-channel-title ellipsized"><span class="qualified-channel-title-w ...

Ensure the first column is fixed and all other columns have the same height

I have encountered an issue where the first column of my table has varying heights compared to the other columns, resulting in inconsistent row heights. Below is the code I am using: <div class="outer"> <div class="inner"> <table> ...

Encountering persistent issues while attempting to integrate socket.io into my Node.js application with Express

Recently, I've been exploring ways to create a textbox that allows multiple users to type simultaneously. Below is the HTML code: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> ...