Hover interactions with links and their associated containers

$(document).ready(function(){
$("a").mouseover(function(){
var currentId = $(this).attr('id')+"S";
$(".stay:visible").hide("explode",[],200);
$("#" + currentId).show("bounce");
});
});

.stay { 
display:none;
      }
<body>
<div id="parent">
  <a id="aaa"></a>
  <a id="bbb"></a>
  <a id="ccc"></a>
  <div id="holder">
     <div class="stay" style="display:inline"></div><!--Starting Div, leaving on first mouseover-->
     <div class="stay" id="aaaS"></div>
     <div class="stay" id="bbbS"></div>
     <div class="stay" id="cccS"></div>
  </div>
</div>
</body>

I have created a setup with anchors and corresponding div elements for each one, all sharing the "stay" class. Initially, the divs are hidden, but I want them to display in a holder div when their corresponding anchor is moused over. When I previously scripted this individually, quick hovering caused all the divs to stack down the page. I tried using .stop() and .clearqueue() without success, so now I am attempting a more encompassing approach. The problem I am facing is that the script fails to identify the correct anchor element to extract the ID from. As a newcomer to this, any assistance would be greatly appreciated. Edit - I have managed to select the divs correctly, but they still stack down the page if hovered over rapidly.

Answer №1

Decided to utilize the hoverIntent plugin and couldn't be more pleased with the outcome.

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

Prevent dropdown from closing when clicking outside of it

Ensure the dropdown remains open when clicking outside of it. Display and hide dropdown only when button is clicked. Check out the JSFiddle link. <div class="dropdown"> <button class="btn btn-primary dropdown-toggle" type="button" data-toggl ...

Is there a way to pass select2 value to my Java code?

I am currently working on a Jira Plugin that utilizes Servlet and Rest technologies. The plugin is designed to display project names in a select2 list, and when a user makes a selection, the datatable will show the corresponding Issue keys and summaries. ...

Eliminating rows from a DataTable through an Ajax request

I have a DataTables table from datatables.net with a custom column containing icons for various actions. One of these actions is deleting a row without reloading the data. I'm looking for a built-in function to remove datatable rows locally after dele ...

Looking for a method to select checkboxes using PHP? Consider utilizing a value to achieve this task

What is the correct way to define the isset function? When written as shown here, PHP does not register the click. `if(!isset($_POST['checkbox1']) || !isset($_POST['checkbox2']) || !isset($_POST['checkbox']) ) { ...

Test your word skills with the Jumbled Words Game. Receive an alert when

After reviewing the code for a jumble word game, I noticed that it checks each alphabet individually and locks it if correct. However, I would like to modify it so that the entire word is only locked if all the letters are correct. Any suggestions on how t ...

Guide to Displaying Items in Order, Concealing Them, and Looping in jQuery

I am trying to create a unique animation where three lines of text appear in succession, then hide, and then reappear in succession. I have successfully split the lines into span tags to make them appear one after the other. However, I am struggling to fin ...

Incorporating CSS code directly into a PHP webpage instead of linking to an external CSS

I've been struggling to find a solution for this issue. I am trying to figure out how to insert CSS code into my PHP page. My PHP page contains scripts and uses echo to display HTML elements when the page loads. Among these elements are three forms w ...

Is there a method to achieve a similar effect as col-md and col-sm but for adjusting height instead?

I'm looking for a way to adjust the height based on the device size like how sm, md, and lg classes work. I'm designing a login form that looks great on cell phones, but appears too tall with excessive spacing when viewed on an iPad. There are la ...

What is the best way to align text at the center of a circular animation?

I stumbled upon this fascinating animation and I'm looking to incorporate it into my project. However, I'm facing a challenge in centering text inside the circle without resorting to using position absolute. My goal is to have the text with the ...

Want to ensure a span is perfectly centered both vertically and horizontally within a div using minimal CSS code?

I am currently working with LESS (CSS) and facing an issue with aligning a span element (which contains button text) inside a div container (button). The span is horizontally centered but vertically aligned to the top. I also want the span to automatically ...

When utilizing the .replaceWith() function in jQuery, the event bindings do not stay intact

Here is a brief example. Please note that the .chat-reply class has a click event handler attached to it. The HTML (Reply Button): <div class="container"> <a href="#" class="btn small chat-reply">Reply</a> </div> When anothe ...

Column Alignment Problem in Bootstrap

I'm currently working on a blog template project that resembles the design of this particular page However, I've encountered an issue with aligning the grids in a way that meets my requirements. To showcase my problem, I have shared my version o ...

Issues with POST server-side JSON output in jQuery DataTables

Attempting to configure my datatable to receive a POST JSON response from the server. Below is the code on the client side: <script> $(document).ready(function() { $('#example').dataTable( { "bProcessing": true, "bServ ...

utilize ajax success method to extract json data

I'm currently working on displaying and parsing JSON data in the success function of an AJAX call. This is what I have so far: AJAX: data = "Title=" + $("#Title").val() + "&geography=" + $("#geography").val(); alert(data); url= "/portal/getRe ...

Is it possible to serve CSS using relative paths that go beyond the URL root?

I've encountered a file path issue with my HTML and CSS files. My HTML file is located in: src/test/html/index.html And the corresponding CSS file is in: src/test/css/index.css In the HTML file, the CSS is linked using: <link rel="stylesheet" ...

Choose a specific location on a vehicle illustration within a pop-up window. The image should be partitioned into 6 separate sections

I have a project for my client where they need to choose a car and then indicate where the damage is located on an image, which is divided into 6 sections. I'm struggling to figure out how to achieve this. I initially thought z-index would work, but ...

When using Ajax in Jquery and expecting data of type JSON, the response always seems

Looking to create a basic jQuery Ajax script that checks a user's discount code when the "Check Discount Code" button is clicked? Check out this prototype: <script> jQuery(function($) { $("#btn-check-discount").click(function() { c ...

The gap between columns in Bootstrap grids

Currently, I am dynamically fetching "boxes" and adding them to the HTML document using ngFor. The number of boxes is unknown in advance. Here is the code I am currently using: <div *ngIf="items && items.length" class="row"&g ...

Transform your data visualization with Highcharts enhanced with the stylish appearance of DHTML

I am currently using a dhtmlx menu with my charts, specifically the legendItemClick event. It worked perfectly when I was using highcharts 3.0.1. However, after upgrading to version 4.1.7, the function legendMenu_<?=$id?>.showContextMenu(x,y) in the ...

Entering credit card information in a modal popup using Bootstrap form

I have implemented a bootstrap modal for my credit card payment form and now I want to validate the credit card information. Currently, I am using basic validation in jQuery. <script> $(function() { $('#error_message_reg').text(""); //$( " ...