Having trouble with making the jQuery animate toggle function properly executed

I am trying to create a panel that is positioned behind the header of my website, with a tab that sticks out below the header. When this tab is clicked, I want the panel to slide down from behind the header, and when clicked again, I want it to slide back up. Since I have never worked with JavaScript before, I have put together some code but seem to be missing something...

Could someone please guide me on what I might be doing wrong? My goal is for the panel to smoothly slide down and up, and I would like the code to be as concise as possible. You can view my test site here:

CSS (Please note that I have temporarily increased the z-index of this element to show its position relative to the header).

#panel-hhs
{
  position: relative;
  height: 166px;
  width: 206px;
  top: 0;
  left: 0;
  margin-top: -137px;
  margin-left: 998px;
  background: url('images/hhs_panel.png');
  background-repeat: no-repeat;
  background-position: center;
  z-index: 130;
}

HTML (I have included my entire header; the JavaScript is at the bottom)

<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/jQuery.js"></script>
<script type="text/javascript" src="<?php bloginfo('template_url'); ?>/jQueryUI.js"></script>
<script src="http://widgets.twimg.com/j/2/widget.js"></script>

</head>
<body>
<div id="banner-wrap">
  <div id="banner-bar">
    <div id="banner-hood">
      <center><img src="http://test.vtisvc.com/wp-content/themes/brk_2013/images/header_hood.png" style="float:center"></center>
        <div id="banner-logo"><center><img src="http://test.vtisvc.com/wp-content/themes/brk_2013/images/header_logo4.png" style="float:center"></center></div>
        <div id="banner-text"><center><a href="#"><font face="georgia" color="#8a0304&quot;">HOME</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"><font face="georgia" color="#8a0304">LISTINGS</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"><font face="georgia" color="#8a0304">AGENTS</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"><font face="georgia" color="#8a0304">SEARCH MLS</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"><font face="georgia" color="#8a0304">RENTALS</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="http://www.google.com"><font face="georgia" color="#8a0304">HISTORY</font></a>&nbsp;&nbsp;&nbsp;&nbsp;<a href="#"><font face="georgia" color="#8a0304">CONTACT</font></a></center></div>
        <div id="banner-svc"><center><img src="http://test.vtisvc.com/wp-content/themes/brk_2013/images/header_svc.png"></center></div>
    </div>
  </div>
<script type="text/javascript">

jQuery(document).ready(function() {
    jquery("#panel-hhs").toggle(function() {
        jquery(this).animate({top: "-=100px"});
    }, function() {
        jquery(this).animate({top: "+=100px"});
    });
});

</script>
<div id="panel-hhs"><img src="http://test.vtisvc.com/wp-content/themes/brk_2013/images/hhs_pic2.png"></div>
</div>

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

Making the navbar color modifications to the dropdown menu

I am currently working on applying color changes to the text in my navbar for the links that have been visited, are active, and are being hovered over. I have successfully implemented this for my regular hyperlink elements. However, I am facing an issue wi ...

Make sure to save the HTML content after we make an AJAX call to retrieve it

Is there a way to call an HTML file using Ajax and then save the response as an HTML file in a specific location? I have been trying to make an Ajax call using jQuery, like shown below: $.ajax({ type: "POST", url: "../../../project/html/T ...

Is it possible to create a date string with a time-zone without relying on JavaScript substring functions or regular expressions?

Is it possible to generate the string "2013-02-01T00:00:00-05:00" using only the Date object's built-in methods, without utilizing regular expressions or substring manipulation techniques? ...

The Mapbox map fails to display properly upon initial page load

When my Mapbox map loads, I am experiencing issues with it only rendering partially. It seems that adjusting the width of the browser or inspecting the page will cause the map to snap into place and display correctly. To demonstrate this problem, I created ...

Angular can be used to compare two arrays and display the matching values in a table

Having two arrays of objects, I attempted to compare them and display the matching values in a table. While looping through both arrays and comparing them by Id, I was able to find three matches. However, when trying to display these values in a table, onl ...

React Error: Invalid Element Type with Named Exports

I've been diving into the world of React hooks and functions, working on three different files. First, there's one that establishes a context called SummaryContext. The second file contains a class component that consumes this context named WikiS ...

Personalize your jQuery function

Is there a way to enhance jQuery functions like hide() or show()? Specifically, I want my custom function to be executed along with the base jQuery function whenever I use hide(). If this is possible, could you please demonstrate how? Thanks. ...

Empty space to the right of the page when viewed on mobile devices

I am currently learning how to develop websites. I am in the process of building a page for practice, but I have encountered an issue. The page is not responsive below 630px width, and there seems to be white space appearing on the right side of the page. ...

Troubleshooting the problem of page refreshing in an Angular JS application

I've been working on an angular application and have implemented "$locationProvider.html5Mode(true)" in my route configuration to eliminate the use of /#/ in URLs. Additionally, I've included base href="/" in index.html and everything functions p ...

There seems to be a glitch in my code - if you try clicking on the same thumbnail twice,

When I click on the same thumb twice, the image fades out but does not fade back in. It would be ideal if the active thumb is not selectable. Any assistance with this issue would be greatly appreciated. Thank you. To better illustrate what I am experienci ...

Exploring the Power of React's Ref API

Currently, I am following tutorials on Udemy by Max where he discusses how to work with Ref Api's in React 16.3. In one of the lectures, he demonstrated creating a ref inside a container class, not App.js, using this.lastref = React.createRef();. He ...

Is there a way to stop the dropdown from automatically appearing in a DropDownList?

Seeking a solution to use a custom table as the dropdown portion for a DropDownList in my project. My goal is for users to see the custom table when they click on the DropDownList, rather than the default dropdown menu. I expected to be able to achieve th ...

Detecting Specific Web Browsers on My Website: What's the Best Approach?

My website is experiencing compatibility issues with certain browsers, such as Firefox. I want to display a message when users visit the webpage using an unsupported browser, similar to how http://species-in-pieces.com shows a notification saying "Works ...

Looking for the answer? Keep on searching, as the solution isn't within the card article below

Thank you for taking the time to read this :) I am trying to create a layout where articles are displayed one below the other in card style, but I am struggling to find a solution to my problem. I have experimented with z-index, absolute and relative pos ...

I encountered an issue in ReactJS where I received a TypeError stating that props.history.listen is not a function

Why is this showing up? I'm using ReactJS and can't figure out what's going wrong. Here is my history.js: import { createBrowserHistory } from 'history' export default createBrowserHistory In my App.js: import React from 'r ...

Unspecified variable in AngularJS data binding with Onsen UI

I am new to Onsen UI and AngularJS, and I have a simple question about data binding. When I use the variable $scope.name with ng-model in an Onsen UI template, it returns as UNDEFINED. Here is my code: <!doctype html> <html lang="en" ng-app="simp ...

My website is being cut off

After creating this website with a viewport setup, I noticed that it is not fully visible on certain screens. When viewed on a CRT monitor at 800x600 desktop resolution or lower than 1280x800, such as on mobile devices, the content gets clipped. Is there a ...

How can I display the image within a div prior to uploading it?

I have five separate input files, and I want any uploaded image to display inside its own corresponding div. For example, when I upload an image using the first input file, it should show up inside the first div, and so on for the rest of the inputs. The ...

Displaying a progress bar while uploading images in PHP: A step-by-step guide

I have written the following code: $(function(){ var btnUpload=$('#browse'); var adinfoid=$('#adinfoid').val(); new AjaxUpload(btnUpload, { action: '<?php echo base_url()?>index.php/post/upload_editmainimage/'+adin ...

"Unlocking the Power of Promises: A Beginner's Guide to Utilizing JavaScript Prom

I recently started using Redux in my project and I encountered a scenario where I needed to make a network call after updating the store. To achieve this, I decided to use promises like so: let promise = new Promise(function(resolve, reject) { updateSt ...