Ways to ensure that the dropdown content remains visible even after the mouse has exited the trigger element

There are three buttons arranged in a row, and when one is hovered over, dropdown content appears underneath all three buttons. However, the content disappears when the mouse moves down to it. Unfortunately, images cannot be posted inside yet** https://i.sstatic.net/ipqYZ.jpg https://i.sstatic.net/5wigq.jpg

I have attempted moving the dropdown content into the same divs, but I am unable to make the content take up the entire bottom space. It seems like I may need to reconstruct everything. Apologies if this question does not make sense

class DropDown {
  constructor() {
    // Cards 
    this.serveCard = $('#serve-card');
    this.protectCard = $('.protect-card');
    this.commercialCard = $('#commercial-card');
    // Dropdown Area for Cards
    this.dropServe = $('#serve-card-dropdown');
    this.dropProtect = $('#protect-card-dropdown');
    this.dropCommercial = $('#commercial-card-dropdown');


    // Dropdown Container 

    this.dropDownContainer = $('#drop_down_container');
    this.events();

  }
  events() {

    this.protectCard.hover(this.dropDownIn.bind(this.dropProtect),
      this.dropDownOut.bind(this.dropProtect));

    this.serveCard.hover(this.dropDownIn.bind(this.dropServe),
      this.dropDownOut.bind(this.dropServe).bind(this));

    this.commercialCard.hover(this.dropDownIn.bind(this.dropCommercial),
      this.dropDownOut.bind(this.dropCommercial));


    // Style Cards On Hover

    this.protectCard.hover(this.styleCard.bind(this.protectCard),
      this.styleCard.bind(this.protectCard));

    this.serveCard.hover(this.styleCard.bind(this.serveCard),
      this.styleCard.bind(this.serveCard));

    this.commercialCard.hover(this.styleCard.bind(this.commercialCard),
      this.styleCard.bind(this.commercialCard));
  }

  dropDownIn() {
    this.removeClass('inactive');
  }
  dropDownOut() {

    this.addClass('inactive');
  }

  styleCard() {
    this.toggleClass('inactive');
  }

}
/* Dropdown Menu --------- */

.blue_card {
  border: 2px solid white;
  margin: 0px 1% 0 1%;
  padding-top: 25px;
  background-color: rgb(0, 119, 204);
  color: white;
  border-bottom: none;
}

.blue_card.inactive {
  background-color: rgba(88, 128, 155, 0.424);
  border-bottom: none;
}

.drop-down-cont {
  position: relative;
}

.drop-down {
  background-color: rgb(0, 119, 204);
  margin-right: 10px;
  margin-left: 1%;
  position: absolute;
  top: 0;
  height: 100px;
  width: 98%;
  transition: height 500ms;
  border-right: 2px solid white;
  border-left: 2px solid white;
  border-top: 2px solid white;
  border-bottom: 2px solid white;
  color: white;
}

.drop-down.inactive {
  height: 0;
  transition: height 500ms;
  font-size: 0;
  border-bottom: none;
  border-top: none;
}
<div class="row blue-card-cont">
  <div id='protect-card' class="protect-card col blue_card inactive">
    <h5>PROTECT</h5>
    <p>PROTECT WITH COPYRIGHT</p>
  </div>
  <div id='serve-card' class="col blue_card inactive">
    <h5>SERVE</h5>
    <p>PROTECT DATA ENTRY. KILL THREATS</p>
  </div>

  <div id='commercial-card' class="col blue_card inactive">
    <h5>COMMERCIALISE</h5>
    <p>CREATE NEW BUSINESS</p>
  </div>

</div>
<div id='#drop_down_container' class="drop-down-cont">
  <div id='protect-card-dropdown' class="drop-down inactive">
    <p>Protect</p>
  </div>
  <div id='serve-card-dropdown' class="drop-down inactive">
    <p>Serve</p>
  </div>
  <div id='commercial-card-dropdown' class="drop-down inactive">
    <p>Commercial</p>
  </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

Why does the flex-start and flex-end values correspond to the top and bottom positions when using the flex-direction property set

I am attempting to organize text and buttons into a row, with the buttons aligned on the right side and the text on the left side. My approach involves creating a flexbox layout and assigning items the appropriate classes for alignment. html, body { widt ...

What is causing my jQuery to only impact the initial item in my iron-list?

How can I create a toggle effect for the left border of an iron-list entry in Polymer when clicking on it? I found some jQuery code that adds the border to the first entry clicked, but I need help extending this functionality to apply to all list entries ...

Using space as a separator for thousands when formatting integers

In an attempt to change the appearance of 1000 to resemble 10 000, I found numerous examples online on how to add a separator such as a comma or some StringLocal. However, I am looking for a way to use a space instead. Can anyone advise me on which locale ...

The position of the carousel items changes unpredictably

My jQuery carousel consists of 6 individual items scrolling horizontally. Although the scroll function is working correctly, I have noticed that 2 of the items are randomly changing their vertical position by approximately 15 pixels. Upon reviewing the HT ...

Jquery's remove function fails to function correctly when used on a cloned element

I am facing an issue where I have a list of rows that need to be deleted. However, when I attempted to use jQuery's remove function, it only removed the original row and not its clone. My goal is for the parent element of the parent to be removed when ...

Having trouble initializing the canvas with fabric.js and Vue.js, as the function this.lowerCanvasEl.getContext is not recognized

When attempting to initialize a canvas in a VueJS component, I encountered an issue. Here is an example: https://jsfiddle.net/eywraw8t/55338/ I tried initializing the canvas in the mounted hook, ensuring that the DOM is available. Fabric seems to be worki ...

Despite being initialized previously in JavaScript, the attribute of the object is still showing as undefined

After using an attribute from an Object multiple times, it suddenly appears as undefined when I call it in another function. Even though I have checked its values with console.log and they seem to be assigned correctly. Can anyone help me figure out what I ...

Angular single page application with a sleek, user-friendly navigation bar for easy browsing

I have been attempting to solve the issue at hand without much success. As a newcomer to web development, I have been working on creating a basic app using angularjs and bootstrap. My pages are fairly sparse, consisting only of a few inputs and buttons t ...

Tips for defining conditions within the style attribute in JSP

Below is the code that I attempted: <div style="width:85%;"> <input class="formbutt" value="AddNew" title="AddNew" type="button" style="{(${projectEnvironmentBean.divStyle}=='dipslay:none') ? 'display:block' :'display: ...

Converting HTML/Javascript codes for Android Application use in Eclipse: A Step-by-Step Guide

How can I implement this in Java? Here is the HTML: <head> <title>Google Maps JavaScript API v3 Example: Geocoding Simple</title> <link href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" rel="styles ...

Submitting information through Ajax

Struggling to update a field in my database using AJAX. No errors in console, but the DB won't update. Anyone able to help? AJAX: function ajaxUpdate() { var arr = {var1: name, var2: age}; $.ajax({ url: 'aja ...

Vuejs components that have checkboxes already selected out of the box

Hey there, I'm facing a small issue. Whenever I click on the areas highlighted in the image, the checkbox on the left gets marked as well. Any idea why this might be happening? https://i.stack.imgur.com/nqFip.png <div class="form-check my-5&qu ...

Tips on skipping the need to repeatedly use `@ApiProperty()` for every dto in NestJs-swagger

I'm currently exploring ways to streamline the process of specifying @ApiProperty() for each DTO. I've heard about a method involving the creation of a nest-cli.json file, where if you define Promise<DTO> in your controller within nest-swa ...

Tips for effectively utilizing the updateAxisPointer function in the latest version of vue-echarts (v4.1)

Version 3 allows for direct use of the echarts functions and events, with the ability to override event functions like const updateAxisPointer = function(event)... However, I am struggling to implement this in version 4. You can find more information about ...

Modifying the color of the tooltip arrow in Bootstrap 4: A step-by-step guide

How can I change the arrow color of the tooltip using Bootstrap 4? Here is my current code: HTML: <div class="tooltip-main" data-toggle="tooltip" data-placement="top" data-original-title="Service fee helps Driveoo run the platform and provide dedicate ...

Arrangement of tables using HTML and CSS on the outdoor patio

Looking for advice on how to align buttons in the last column of a table outside of the table but in the same row. The attached image shows the current layout: https://i.sstatic.net/Ex5AR.png ...

Creating a Personalized Tab Layout with react-bootstrap

Incorporating react-bootstrap components and styled components, I have implemented tabs in my project. The current appearance of the tabs is as shown here: https://i.sstatic.net/rPnlO.png However, my requirement is to have the tabs look like this inst ...

Ways to access the content of the chosen <td> element using Vue?

I have a dynamic table where I retrieve data using $.ajax() from a database. The content in the rows is editable, and I need to save the changes made with vue.js. After updating the content, an $.ajax() function with 4 parameters (name, client_id, url, and ...

Tips for passing a parameter (such as an ID) through a URL using ng-click to display a subdocument belonging to a particular user in

I am looking to retrieve specific user subdocument data on a separate page by passing the id parameter in a URL using ng-click in AngularJS. <tr ng-repeat="register in registerlist | filter:searchText"> <td>{{$index+1}}</td> <td&g ...

The Context API leaves me feeling lost and confused

I am currently utilizing Auth0 for user sign up. My goal is to extract the user id listed under sub:value, and then add it to my database to associate it with a user's post. To achieve this, I am attempting to utilize a Context API to retrieve the use ...