Is the top bar feature malfunctioning in version 4.3.2 of Foundation?

During my previous project, I utilized the open-source Foundation 4 framework and successfully implemented a top bar navigation. Now, as I embark on a new project with Foundation, I have downloaded the Foundation 4.3.2 version from . Despite referencing the CSS and JS files of the Foundation 4.3.2 version in my new project, the top bar is not rendering correctly and appears as a tree view instead of the expected navigation bar.

Interestingly, when I revert back to referencing the Foundation 4 version, the top bar functions as intended. So, the question arises - why is the top bar not working when I reference the Foundation 4.3.2 version?

Below is the HTML code snippet:

<html>
<head id="head2" runat="server">
<meta charset="UTF-8" />

<asp:ContentPlaceHolder ID="Title" runat="server">
<title>sample project</title>
</asp:ContentPlaceHolder>
<asp:ContentPlaceHolder ID="Head" runat="server">
</asp:ContentPlaceHolder>

<link href="../../Scripts/css/foundation.css" rel="Stylesheet" type="text/css" />

 <script  src="../../Scripts/js/foundation.min.js" type="text/javascript"></script>

 <script  src="../../Scripts/js/vendor/custom.modernizr.js" type="text/javascript"></script>

</head>

<body>

<form id="form1" runat="server">

<div class="row">
<div class="large-12 columns">
<img src="../../Scripts/img/logo.png" />
</div>
</div>

<div class="row">
<div class="large-12 column">
<nav class="top-bar">
<section class="top-bar-section"> 
<ul class="left">
<li class="divider"></li>
<li class="has-dropdown">Moderate</li>
<ul class="dropdown">
<li><a href="#">Moderate Posts</a></li>
<li><a href="#">New Post</a></li>
<li><a href="#">Send E-mail</a></li>
</ul>
<li class="divider"></li>
<li class="has-dropdown">Options</li>
<ul class="dropdown">
<li><a href="#">Statistics</a></li>
<li><a href="#">Users</a></li>
<li><a href="#">Change Password</a></li>
<li><a href="#">Reports</a></li>
</ul>
<li class="divider"></li>
<li class="has-dropdown">Configuration</li>
<ul class="dropdown">
<li><a href="#">Categories</a></li>
<li><a href="#">Fields</a></li>
<li><a href="#">Locations</a></li>
<li><a href="#">Localities</a></li>
<li><a href="#">E-mail Templates</a></li>
<li><a href="#">Admin Users</a></li>
</ul>
</ul>

</section>
</nav>

</div>
</div>

<div class="row" >
    <div class="large-12 columns ">
    <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
</asp:ContentPlaceHolder>
    </div>
    </div>

<div class="row" >
    <div class="large-12 columns ">
    Copyright @2014 
      </div>
  </div>

<script type="text/javascript">
    document.write('<script src=' +
  ('__proto__' in {} ? '../../Scripts/js/vendor/zepto' : '../../Scripts/js/vendor/jquery') +
  '.js><\/script>')
  </script> 
<script src="../../Scripts/js/foundation.min.js" type="text/javascript"></script> 
<script src="../../Scripts/js/foundation/foundation.topbar.js"></script>

<script type="text/javascript">
    $(document).foundation();


    function setLayout() {
        winWid = $(window).width();
        if (winWid > 750) {
            $(".trd").each(function (index) {
                ht = $(this).height();
                $(this).parent().closest('.row').find('.advt').css('height', ht - 16 + "px");
            })
        }
    }

    $(window).resize(function () {
        setTimeout("setLayout()", 1000);
    });

    setLayout()

  </script>

</form>

</body>
</html>

It's worth noting that there are no runtime errors, but the webpage appears as a tree view (using ul and li elements) without any application of the Foundation 4.3.2 version.

My goal is to have the webpage resemble the image below:

Answer №1

Here is the revised code snippet:

<html>
<head id="head2" runat="server">
    <meta charset="UTF-8" />

    <asp:ContentPlaceHolder ID="Title" runat="server">
        <title>sample project</title>
    </asp:ContentPlaceHolder>
    <asp:ContentPlaceHolder ID="Head" runat="server">
    </asp:ContentPlaceHolder>

    <link href="../../Scripts/css/foundation.css" rel="Stylesheet" type="text/css" />
    <script src="../../Scripts/js/vendor/custom.modernizr.js" type="text/javascript"></script>

</head>
<body>

    <form id="form1" runat="server">
        <div class="row">
            <div class="large-12 columns">
                <img src="../../Scripts/img/logo.png" />
            </div>
        </div>

        <div class="row">
            <div class="large-12 column">
                <nav class="top-bar">
                    <section class="top-bar-section">
                        <ul class="left">
                            <li class="divider"></li>
                            <li class="has-dropdown"><a href="#">Moderate</a>
                                <ul class="dropdown">
                                    <li><a href="#">Moderate Posts</a></li>
                                    <li><a href="#">New Post</a></li>
                                    <li><a href="#">Send E-mail</a></li>
                                </ul>
                            </li>
                            <li class="divider"></li>
                            <li class="has-dropdown"><a href="#">Options</a>
                                <ul class="dropdown">
                                    <li><a href="#">Statistics</a></li>
                                    <li><a href="#">Users</a></li>
                                    <li><a href="#">Change Password</a></li>
                                    <li><a href="#">Reports</a></li>
                                </ul>
                            </li>
                            <li class="divider"></li>
                            <li class="has-dropdown"><a href="#">Configuration</a>
                                <ul class="dropdown">
                                    <li><a href="#">Categories</a></li>
                                    <li><a href="#">Fields</a></li>
                                    <li><a href="#">Locations</a></li>
                                    <li><a href="#">Localities</a></li>
                                    <li><a href="#">E-mail Templates</a></li>
                                    <li><a href="#">Admin Users</a></li>
                                </ul>
                            </li>
                        </ul>
                    </section>
                </nav>
            </div>
        </div>

        <div class="row">
            <div class="large-12 columns ">
                <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">
                </asp:ContentPlaceHolder>
            </div>
        </div>

        <div class="row">
            <div class="large-12 columns ">
                Copyright @2014
            </div>
        </div>

        <script type="text/javascript">
            document.write('<script src=' +
                ('__proto__' in {} ? '../../Scripts/js/vendor/zepto' : '../../Scripts/js/vendor/jquery') +
                '.js></script>');
        </script>

        <script src="../../Scripts/js/foundation.min.js" type="text/javascript"></script>

        <script type="text/javascript">
            $(document).foundation();


            function setLayout() {
                winWid = $(window).width();
                if (winWid > 750) {
                    $(".trd").each(function (index) {
                        ht = $(this).height();
                        $(this).parent().closest('.row').find('.advt').css('height', ht - 16 + "px");
                    })
                }
            }

            $(window).resize(function () {
                setTimeout("setLayout()", 1000);
            });

            setLayout()

        </script>
    </form>
</body>
</html>

Changes made include formatting the code for readability, removing duplicate calls to foundation.min.js, excluding the call to

foundation.topbar.js</code, and restructuring dropdown menus to comply with Foundation standards for proper interpretation. Lastly, a missing semi-colon was added to the <code>document.write()
statement that includes jQuery/zepto.

Answer №2

The issue is not related to the foundation 4.3.2 version, but rather to modifications I made in the foundation.css file itself. These changes caused problems on my webpage. Once I removed the alterations made in the foundation.css, the top-bar navigation appeared again.

It is advisable not to edit the foundation.css directly. Instead, it is better to create customized CSS for our specific needs.

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

Tips for restricting navbar-fixed to the width of the container

Welcome to my first project utilizing Twitter Bootstrap. While using Twitter Bootstrap, I've noticed that whether I use container-fluid or just container for my fixed top navbar, it expands to full width of the browser once it reaches around 980px. T ...

Tips for retrieving JSON data from an AJAX call and displaying it pre-filled in an input field

Here is the code snippet I used to receive a response in JSON format, but when I try to display the response using alert(response.Subject);, it shows as "undefined". HTML: <input type="text" id="subject" value='Subject'> Javascript: $.a ...

Fixed position of the rotated button placed at a 90-degree angle on the right side of the screen

Recently, I had a project where I had to include a div that was rotated 90 degrees and fixed to the right side of the screen. The challenge was making sure that as you scrolled down, the button moved along with the screen while maintaining responsiveness. ...

When using Vue2, pushing a string to an array simply replaces the existing string instead of appending it

My current task involves manipulating a local data array by adding and removing strings within a method. However, I have noticed that my logic always results in the array containing only a single string passed to the updateIdArr method. Even after removin ...

Express 4 Multer shows an error where req.body and res.json are not defined

As I attempt to achieve a single image file upload along with text fields using Express 4.0 and multer 1.1.0, I am facing certain challenges. The image file is successfully uploaded to the designated location, but issues arise with the text fields and resp ...

Transferring PHP and JavaScript variables via AJAX to PHP page and storing in MySQL database table

After searching through numerous similar questions, I still haven't found the exact answer I need. I have a set of js variables that are sent via ajax to a location.php file, where they will be inserted into a mysql table. The current ajax call looks ...

The disadvantages of manipulating DOM in controllers in AngularJS

Many experts advise against performing DOM manipulations in AngularJS Controllers, but it can be challenging to fully understand why this is considered a best practice. While sources mention issues with testing and the primary purpose of controllers for di ...

Locate the coordinates on an HTML5 canvas that correspond to a specified color

Is there a more efficient method to identify the coordinates of pixels with a particular color without looping through every pixel in the image? ...

Using JavaScript values retrieved from a database to dynamically adjust the options in the second dropdown menu based on the selection made in the

I am currently working on a feature that involves populating two dropdown menus with values from a database. The idea is that when an option is selected in the first dropdown, the second dropdown should dynamically display relevant values based on that s ...

Retrieving the value of a TextField from Material-UI upon submission

Is it possible to capture the value from a TextField input and display a message conditionally using onSubmit instead of onChange? I have tried implementing this functionality dynamically with onChange, but now I would like to achieve the same result wit ...

Adjusting the X-axis in Highstock: Tips and Tricks

Is there a way to adjust the X axis on this chart? My goal is to shift it so that it only covers half of the width, leaving the other half blank for future plotlines. Any suggestions on how to achieve this? Thanks! :) ...

What is the purpose of using a hash in a WebSocket handshake?

When establishing a Websocket connection, the client initiates by connecting to a tcp socket on a server and then performs a handshake. In the client's handshake, there is a base64 encoded key (Sec-WebScoket-Key). The expected response from the serv ...

Error: The function $compile does not exist

Currently, I am working on developing an AngularJS directive using TypeScript. While testing my code in the browser, I encountered the following error: TypeError: $compile is not a function at compileComponent.js:14 Interestingly, the TypeScript compiler ...

When uploading a file using the file input in a table row, the text input will only appear in the first row and not in

I have a new application available for testing: VIEW APPLICATION Kindly follow the steps outlined below: Click the Add Question button twice to add 2 file inputs to the table below: Using the file input in TABLE ROW 1, upload 2 images (one at a time ...

Text fades into view from the bottom after a line break using CSS and JavaScript

I'm looking to create a unique fade reveal text effect for a multi-line H1. The goal is for each line of the text to fade up from its own row, rather than simply revealing from the bottom. Here's an example I've already developed, but it cu ...

The card header in Bootstrap card grid does not have the ability to extend all the way to the edge of

Utilizing bootstrap 4 within Laravel, I create blade.php template files. Here is a snippet of my code. The card grid layout appears satisfactory, however, there seems to be some empty space between the card titles and the edges of the cards. <div id=" ...

Converting Uniquely Designed Photoshop Shapes into HTML

I am working on a project to design an HTML page that features a profile picture with a heart frame. I have the PSD file with the heart frame included. The profile pictures will be rectangular in shape and should fit behind the heart frame without overlap ...

Unable to establish a connection to 'X' as it is not recognized as a valid property

Trying to implement a Tinder-like swiping feature in my Angular project, but encountering an error stating that the property parentSubject is not recognized within my card component. Despite using the @Input() annotation for the property, it still fails to ...

What is the best way to eliminate #name from a URL?

On my website, there is an internal link that currently reads as http://www.example.com/#name. I am looking to modify this link to simply be http://www.example.com. ...

Is it possible to utilize struts tags within HTML tags to set their attributes?

I have come across this code snippet but haven't tested it out yet: <input type="checkbox" id="<bean:write name="element" property="idvalue" />" /> Would this code work as intended? Additionally, are there more efficient ways to achieve ...