The footer menu fails to glide upwards

I designed a top menu for my website that includes 2 key features:

  1. Sticky navigation bar when scrolling
  2. Slide toggle navbar

You can view the demo here: JSBIN

However, I am facing 2 issues:

When the page is at the top and the menu is in its default position, the slide toggle works perfectly.

But after scrolling to the bottom of the page and clicking the arrow below the navbar, the slide toggle feature stops working.

The menu consists of 2 divs:

Main Menu:

<div id="menu" class="top-nav">
  <ul>
    <li class="active"><a href="#home" class="scroll">Home Page</a></li>
    <li><a href="#about" class="scroll">About</a></li>
    <li><a href="#events" class="scroll">Events</a></li>
    <li><a href="#home" class="scroll">Other Page</a></li>
  </ul>
</div>

Footer with arrow key and line under the navbar:

<div id="menu-footer">
  <div style="background:none repeat scroll 0 0 #CD1D27;padding:7px 0;"></div>
  <div id="open-close-toggle" style="background:url(http://up.tractorfc.com/images/48714086549751927852.png) no-repeat;height:32px;background-position:center;"></div>
</div>

The second issue lies within the menu-footer section.

I believe there are more efficient ways to replace this code in order to have an arrow key and display a red line when the menu slides up.

Here is the script I used for the sliding menu bar:

<script>
  $("#open-close-toggle").click(function() {
    $("#menu").slideToggle();
  });
</script>

Apologies for any language errors.

Answer №1

That HTML was giving us some trouble. But fear not, I have a solution that will toggle a class on the footer to make it stay at the top of the page. Check out the updated version here: http://jsbin.com/widaq/2/edit

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

What is the best method to retrieve the minimum and maximum values of a range slider in PHP and

I've successfully implemented a custom range slider using the code snippet below: HTML: <input type="text" class="salary" id="salary" name="salary" style="border:0; color:#f6931f; font-weight:bold;&qu ...

Determining the height of the error container using jQuery validate

I am having difficulty retrieving the height of the error container when using the 'jquery validate' plugin to submit a form with errors. The height value of the error container is not displaying and the alert box is not working. Can someone prov ...

bulk purchase discount with HTML/JavaScript/PHP

I am looking to add a slider feature to my "Prices" page in order to provide customers with an instant quote based on the quantity they select. The slider should range from 1 to 500 or even up to 1000, but having an input box for customers to enter the qu ...

Transforming Plain Text to HTML Format

Currently, I am fetching some Strings from a database and successfully converting them to HTML using the following code: private string StripHTML(string source) { try { string result; // Code for stripping ...

Update the logo for mobile, desktop, and tablet display using Bootstrap 4alpha

I am currently working on customizing a header with Bootstrap 4 alpha. <div class="container"> <div class="row"> <div class="col-md-6 text-md-left text-center"> <div class="navbar-brand"><img src="/wp-con ...

Obtain data from jQuery Data row

I am currently working on an asp.net page where I have implemented jQuery datatables. Below is a snippet of the code: <% foreach (SubmissionSearchResult result in SearchResults) {%> <tr data-name='<%=result.ID %>'> For each r ...

What is the best way to convert this JavaScript iteration function into jQuery?

I recently encountered an issue with my JavaScript function that returns a list of elements with the class ".youtube", loops through them, and calls another function. The JavaScript logic is flawless, but I wanted to convert it into jQuery for better reada ...

Sending an array and an object simultaneously through a single ajax request

I previously inquired about passing an object to an ajax request for my rest service. Now I am wondering if it's possible to pass both an array and an object within a single ajax request. Any insights on this matter would be greatly valued. ...

Building a WordPress calculator form that retains user input without requiring a resubmit and incorporates custom field values

Currently tackling a challenge on my Wordpress website. Without any code yet (after numerous attempts at rewriting 4 different forms), I'll simply outline what I aim to accomplish, confident it's a straightforward task with something crucial elud ...

CSS3 pulsating circular Firefox bug

I am currently working on a CSS3 pulsing circle (animating scale to 1.1). To address a jumpy animation issue in Firefox, I have added a slight rotation. animation: button_pulse 2s infinite ease-out; transform: scale(1.1) rotate(0.1deg); Despite this adju ...

Selecting a checkbox based on the user's previous choice

There is an option on my website for users to opt out of a specific feature. Their decision is stored in the database as either "0" or "1". However, when they return to the site, the checkbox is unchecked even if they had previously selected it. I would l ...

Design and execution of webpage structure

My website features a single-page layout with fixed navigation that allows users to easily navigate up and down the page using #. However, when the page loads I want it to display the second section of content instead of the top section. Is there a way to ...

Exploring the combination of MVC with Ajax.BeginForm and DIV.Load

I have a template that defines an Ajax.BeginForm. The model returned contains a property called ReportLink which holds the URL to a PartialView on the server. In the Ajax.BeginForm.OnSuccessFunction, I am trying to retrieve and load HTML content using $(" ...

JavaScript code is not functioning properly on Internet Explorer 10

Upon selecting an option, I need to activate buttons. This functionality works smoothly in all browsers except for IE10. The HTML for the select element: <select id="tenants" name="tenants" size="10" class="reportOption" onchange=""> <option va ...

Struggling with adding a border to an HTML table?

I am attempting to create a table with alternating borders on the cells. After trying the code below, I still can't seem to get the desired effect. The borders are not showing up at all. Can someone provide guidance on how to achieve this? <style ...

Steps to make pop-up iframe function on the same page within a react nextjs application

My vanilla Html app has a pop-up feature that functions perfectly. When the button is clicked, the pop-up opens and everything works as expected. However, I am encountering an issue when trying to implement this same functionality in my React, NextJS app. ...

Having issues with $_POST not retrieving values from .post

Below is the javascript snippet that I have written: function submitForm() { var name = document.getElementsByName('name').value ,email = document.getElementsByName('email').value ,subject = document.getElementsBy ...

Adjust the text positioning to be lower without affecting the placement of the image

Hey experts: I'm experimenting with something, but can't quite grasp the concept... My main Div contains a paragraph of text and an image (each nested in their own Divs) at the top of the HTML page. The image is styled to float right while stylin ...

I receive an [object HTMLCollection] as the output

I am currently working on recreating a login page and I want it so that when the button is clicked, it displays the name you entered, but instead, it returns [object HTMLCollection]. My expectation was to have the name displayed as entered. var nombre ...

The Oracle Apex Login Interface with a Touch of Customized Styling

Currently, I'm working on creating a login page in Oracle APEX. While modifying the icon using CSS code, everything seems to be falling in place except for this one particular line: .t-Login-logo { background-image:url(#APP_FILES#LogoUpdated.jpg); bac ...