The process of toggling a div to slide up and down explained

I'm attempting to create a slide toggle effect on a hidden DIV when a user hovers over specific link buttons.

JavaScript:

$(function () { // DOM ready shorthand

            var $content = $(".sliderText");
            var $contentdiv = $(".sliderContent");

            var $homeToggle = $("#home");
            var $listToggle = $("#list");

            $contentdiv.hide();

            $homeToggle.hover(function () {
                $content.Text("Navigate to Home");
                $contentdiv.stop().slideToggle();
            });
            $listToggle.hover(function () {
                $content.Text("SDSFDFS");
                $contentdiv.stop().slideToggle();
            });
        });

CSS:

    .sliderContent {
        margin: 0 auto;
        text-align: center;
        border: 2px dotted #00039a;
        padding: 5px;
    }

HTML:

<div>
                <div class="container" id="homeDIV" runat="server" clientidmode="Static">
                    <a id="home" title="Navigate to home page" href="Default.aspx">Home</a>
                </div>
                <div class="container" id="listDIV" runat="server" clientidmode="Static">
                    <a id="list" title="Shows all the fields and their indexes per PDF form in the folder" href="ListFormFields.aspx">List PDF Form Fields</a>
                </div>
                 [...]
            </div>

The goal is for the showText div to expand by sliding down and displaying its contents whenever a user hovers over any of the <a> elements.

Currently, nothing happens when hovering over the links.

How can I make it work?

JSFiddle: http://jsfiddle.net/mt4m2/

Issue recorded here: http://youtu.be/68_kzCygYg4

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

The functionality of Jquery autocomplete can be inconsistent at times

I have implemented this code for autocompleting the input field. While it works well in most cases, there are some instances where it doesn't function as expected. This is relevant for iOS users, Android users, Windows 7, 8, and 10 users, as well as C ...

Unsuccessful attempt at aborting an Ajax request

Currently, I have developed a basic live search feature using jQuery ajax to search through a JSON file on the server and display a list of events. The script is programmed to show a list of events that were previously displayed on the page if the search ...

Modify the content while leaving the button's design intact

So I have this unique scenario where I've created a button with an icon using bootstrap and font-awesome: <button id="btnFavorite" class="btn btn-warning pull-right" style="margin-right: 5px;" onclick="addToFavorites()"> <i id="imgFavori ...

Is it feasible to send a GET form to two separate views using two buttons?

On one view, I have a form that functions perfectly. http://myurl.com/myapp/filter_objects/?risk__worktask=1&craft=3 In another view, I need to export the filtered list to a PDF. Currently, I store the results in session and access the list from ther ...

No JavaScript needed for this CSS framework

I have been tasked with creating a website without the use of JavaScript, following very specific instructions. Furthermore, it must be compatible with iPhone and other mobile devices, while still adhering to the no JavaScript rule. I am open to utilizing ...

Let's unravel this JavaScript enigma: the code snippet window.confirm = divConfirm(strMessage) awaits

Imagine a scenario where you have an old website with a lot of existing JS code. If a user wants to update all the alert messages to modern, stylish Div-based alerts commonly used in jQuery, YUI, Prototype, etc., there are primarily three types of JS dialo ...

Using jQuery to create two identical widgets

Just starting out with JQuery and had a question about a specific problem I'm facing: Imagine you want to include 2 textboxes with datepickers on an HTML page using jQuery UI. Since jQuery works based on "ID" rather than "Class", the following code w ...

Save an automatically generated number into a variable and use it to reference an image file for display. This process can be accomplished using JavaScript

I'm having trouble getting my images to display randomly on a page. The images are named 0 - 9.png and I am using a pre-made function for random number generation. However, when I try to call on this function later down the page, nothing appears. It ...

What is the best way to display the panel during a postback?

I have a group with two radio buttons labeled purchase and expenses. When the purchase radio button is clicked, the panelpurchase will be displayed, and similarly, the panelexpense will show for the expenses radio button. Check out the image of the output ...

Modify the styling of the main webpage using the iframe

Can the CSS of a parent page be modified from an iframe when the parent page and iframe are hosted on separate domains? ...

Using [(ngModel)] in Angular does not capture changes made to input values by JavaScript

I have developed a custom input called formControl, which requires me to fetch and set its value using [(ngModel)]: import { Component, Injector, OnInit, forwardRef } from '@angular/core'; import { ControlValueAccessor, FormControl, NG_VALUE_ACCE ...

The Next.js application is unable to load the combined CSS from a React Component Toolkit

My React components repository includes individual .css files for each component which are imported into the respective components. These components are then bundled using a rollup configuration and published as an NPM package, with all component CSS being ...

Removing Inline Styles Using jQuery Scroll Event

Whenever I reach the scroll position of 1400 and then scroll back to the top, my chat elements (chat1, chat2, chat3, chat4) receive an "empty" inline style but only for a duration of 1 second. After that, the fadeIn effect occurs again every time I scroll ...

Incorporating a unique font into your SAPUI5 application

While experimenting with an expense app design, I decided to incorporate a receipt-like font for a unique look and feel. After discovering the FakeReceipt font, I placed my woff and woff2 files in the same directory as my style.css file, and it worked like ...

Transmit HTML message using the "textarea" tag through email

Whenever I try to send the content of my "textarea" via email, it always ends up being sent as a blank message. How can I fix this issue? Below is my PHP code: <?php $input = json_decode(file_get_contents("php://input"), true); $ToEmail = "<a href ...

Navigate down the page until you reach the section that is set to display as a block

Is it possible to make the page automatically scroll to a specific element located in the middle of the page when changing its display property from none to block? ...

Having trouble with displaying the modal dialog in Twitter Bootstrap 3?

There seems to be an issue with my Twitter Bootstrap modal as it is not rendering the dialog box correctly, and I'm puzzled about the reason behind this. HTML <p class="text-center btn-p"><button class="btn btn-warning" data-toggle="modal" ...

Having an issue with displaying the country name and country code in a table using the Angular7 custom pipe

country code: "ab", "aa", "fr", ... I need to create a custom pipe that will convert a countryCode into a countryName, such as: "ab" → "Abkhazian", "ch" → "Chinese", "fr" ...

The auto-fill feature in Chrome mistakenly inputs the saved username in the wrong field

My web application, coded in HTML/PHP with a login screen, is encountering an issue with Chrome users. After logging in and navigating to the home page, some users are prompted to save their password. This leads to the username appearing in a field unrelat ...

Tips for combining enable and disable properties in flatpickr.js?

I'm facing a challenge with using both the enable and disable properties in flatpickr.js. The enable property returns a range of dates that should be enabled, but I specifically want to disable certain days within that range, like weekends. datePicker ...