How do I get my dropdown div positioned in the correct position?


Mel

When I click on my divs, I want them all to be in the same position, i.e. to the right and below the div content, but they are in the same position as the div I clicked on, as if they were all on top of each other A small box, if that makes sense. I'm not entirely sure how to get them all to move to the right and stay there.

https://jsfiddle.net/frmLuvzn/2/

<div class="col-md-4">
 <div class="card mb-4 shadow-sm">
<div class="content">
  <div class="description">
    The First Album[1989]
  </div>
</div>
<div class="about-section">
  <p class="album">The First Album[1989]</p>
  <p>bands’ classic first record, produced by Mellisa Madrid with Floor, Jake Baker, Keifer Leblanch and Adrian Sherwood.</p>
  <div id="albumlist">
    <p>Tracklist </p>
    <ol class="albumlist">
      <li>Yes</li>
      <li>No</li>
      <li>Idk</li>
      <li>Can you repeat the question?</li>
     </ol>
   </div>
 </div>
 </div>
</div>
<div class="col-md-4">
 <div class="card mb-4 shadow-sm">
   <!-- <img class="card-img-top" src="images/album1.jpg"> -->
</div>
 <div class="content">
   <div class="description">
  The Second Album[1990]
</div>
 </div>
  <div class="about-section">
    <p class="album">The Second Album[1990]</p>
  <p>bands’ classic first record, produced by Mellisa Madrid with Floor, Jake Baker, Keifer Leblanch and Adrian Sherwood.</p>
  <div id="albumlist">
    <p>Tracklist </p>
    <ol class="albumlist">
      <li>Yes</li>
      <li>No</li>
      <li>Idk</li>
      <li>Can you repeat the question?</li>
    </ol>
  </div>
  </div>

  </div>


 <div class="col-md-4">
 <div class="card mb-5 mb-4 shadow-sm">
  </div>
    <div class="content">
<div class="description">The Third Album[1990]</div>
 </div>
    <div class="about-section">

  <p class="album">The Third Album[1990]</p>
  <p>bands’ classic first record, produced by Mellisa Madrid with Floor, Jake Baker, Keifer Leblanch and Adrian Sherwood.</p>
  <div id="albumlist">
    <p>Tracklist </p>
    <ol class="albumlist">
      <li>Yes</li>
      <li>No</li>
      <li>Idk</li>
      <li>Can you repeat the question?</li>
    </ol>
  </div>
</div>

$(function() {
  $('.description').click(function() {
    $(this).closest('.content').siblings('.about-section').toggle(1000);
  })
})
hybrid

You are more suitable to use flexbox. Here is an example:

$(function() {
  $('.description').click(function() {
    $(this).closest('.content').siblings('.about-section').toggle(1000);
  })
})
.about-section{
  display:none;
 }

.wrapper {
  display: flex;
}

.wrapper > div {
  flex: 0 0 33.33%;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>

<div class="wrapper">
<div class="col-md-4">
  <div class="card mb-4 shadow-sm">
    <!-- <img class="card-img-top" src="images/album2.jpeg"> -->
    <div class="content">
      <div class="description">
        The First Album[1989]
      </div>
    </div>
    <div class="about-section">
      <!-- <p id="p1"><img class="float-left" src="images/album2.jpeg" style="width: 500px; height:500px"></p> -->
      <p class="album">The First Album[1989]</p>
      <p>bands’ classic first record, produced by Mellisa Madrid with Floor, Jake Baker, Keifer Leblanch and Adrian Sherwood.</p>
      <div id="albumlist">
        <p>Tracklist </p>
        <ol class="albumlist">
          <li>Yes</li>
          <li>No</li>
          <li>Idk</li>
          <li>Can you repeat the question?</li>
        </ol>
      </div>
    </div>
  </div>
</div>
<div class="col-md-4">
  <div class="card mb-4 shadow-sm">
    <!-- <img class="card-img-top" src="images/album1.jpg"> -->
  </div>
  <div class="content">
    <div class="description">
      The Second Album[1990]
    </div>
  </div>
  <div class="about-section">
      <!-- <p id="p1"><img class="float-left" src="images/album2.jpeg" style="width: 500px; height:500px"></p> -->
      <p class="album">The Second Album[1990]</p>
      <p>bands’ classic first record, produced by Mellisa Madrid with Floor, Jake Baker, Keifer Leblanch and Adrian Sherwood.</p>
      <div id="albumlist">
        <p>Tracklist </p>
        <ol class="albumlist">
          <li>Yes</li>
          <li>No</li>
          <li>Idk</li>
          <li>Can you repeat the question?</li>
        </ol>
      </div>
    </div>

</div>


<div class="col-md-4">
  <div class="card mb-5 mb-4 shadow-sm">
    <!-- <img class="card-img-top" src="images/town.jpg"> -->
  </div>
  <div class="content">
    <div class="description">The Third Album[1990]</div>
  </div>
      <div class="about-section">
      <!-- <p id="p1"><img class="float-left" src="images/album2.jpeg" style="width: 500px; height:500px"></p> -->
      <p class="album">The Third Album[1990]</p>
      <p>bands’ classic first record, produced by Mellisa Madrid with Floor, Jake Baker, Keifer Leblanch and Adrian Sherwood.</p>
      <div id="albumlist">
        <p>Tracklist </p>
        <ol class="albumlist">
          <li>Yes</li>
          <li>No</li>
          <li>Idk</li>
          <li>Can you repeat the question?</li>
        </ol>
      </div>
    </div>
</div>
</div>

Related


How do I get my dropdown div positioned in the correct position?

Mel When I click on my divs, I want them all to be in the same position i.e. to the right and below the div content, but they are in the same position as the div I clicked on, as if they were all on top of each other A small box, if that makes sense. I'm not e

How do I get my Kendo dropdown to work? __

Mr. Bobo Haha I have a kendo Dropdown list and it works fine, but I need to make it a live list without buttons. Whenever I select an item in the dropdown, it automatically updates the content in the grid or the grid queries the dropdown based on the selection

How do I get my dropdown menu back?

Kaz Wolfe Recently I decided I couldn't use KDE for some reason and did a (mostly) seamless uninstall. However, this resulted in a lot of weird icon glitches in a few places: The drop down arrow (or any arrow in it) is now gone and nowhere to be found. Switchi

How do I get my dropdown menu back?

Kaz Wolfe Recently I decided I couldn't use KDE for some reason and did a (mostly) seamless uninstall. However, this resulted in a lot of weird icon glitches in a few places: The drop down arrow (or any arrow in it) is now gone and nowhere to be found. Switchi

How do I get my aliases to have correct completion?

Joshua Cheek Aliases that don't tab complete I have a bunch of aliases like j for jobs (here), and "alias commands" like gs for git status (here). I want them to have the tab completion of the thing they are aliasing. So j -<TAB> would complete like jobs -<TAB

How do I get the bit value at a positioned index in Rust?

Ayu Misra I am trying to execute the following program. fn main() { let a: u8 = 0b00000001; let b: u8 = 0b10101010; let c: u8 = 0b00001111; let length = a.count_ones() + a.count_zeros(); for n in 0..length { println!("{}", a[n]);

How do I get the bit value at a positioned index in Rust?

Ayu Misra I am trying to execute the following program. fn main() { let a: u8 = 0b00000001; let b: u8 = 0b10101010; let c: u8 = 0b00001111; let length = a.count_ones() + a.count_zeros(); for n in 0..length { println!("{}", a[n]);

How do I get the bit value at a positioned index in Rust?

Ayu Misra I am trying to execute the following program. fn main() { let a: u8 = 0b00000001; let b: u8 = 0b10101010; let c: u8 = 0b00001111; let length = a.count_ones() + a.count_zeros(); for n in 0..length { println!("{}", a[n]);

How do I get the bit value at a positioned index in Rust?

Ayu Misra I am trying to execute the following program. fn main() { let a: u8 = 0b00000001; let b: u8 = 0b10101010; let c: u8 = 0b00001111; let length = a.count_ones() + a.count_zeros(); for n in 0..length { println!("{}", a[n]);

How do I get the bit value at a positioned index in Rust?

Ayu Misra I am trying to execute the following program. fn main() { let a: u8 = 0b00000001; let b: u8 = 0b10101010; let c: u8 = 0b00001111; let length = a.count_ones() + a.count_zeros(); for n in 0..length { println!("{}", a[n]);

Skrollr: Fix div to center once I get to the correct position

username This is my first time using skrollr, so I've been trying a lot of things in the last few hours to get the hang of it. The plan is to give a 3D image of the building and when I scroll, the building will rotate 360 degrees. I'm currently using a car as

Skrollr: Fix div to center once I get to the correct position

username This is my first time using skrollr, so I've been trying a lot of things in the last few hours to get the hang of it. The plan is to give a 3D image of the building and when I scroll, the building will rotate 360 degrees. I'm currently using a car as

Skrollr: Fix div to center once I get to the correct position

username This is my first time using skrollr, so I've been trying a lot of things in the last few hours to get the hang of it. The plan is to give a 3D image of the building and when I scroll, the building will rotate 360 degrees. I'm currently using a car as

Why is my position: absolute div positioned differently in Edge?

Daniel We're trying to put a badge in the corner of the image. For this, we use the parent <div>as a wrapper and <span>inside. So far it works fine for Chrome, Firefox and IE11, but not as expected in MS Edge. It seems that the properties computed by Edge are

Why is my position: absolute div positioned differently in Edge?

Daniel We're trying to put a badge in the corner of the image. For this, we use the parent <div>as a wrapper and <span>inside. So far it works fine for Chrome, Firefox and IE11, but not as expected in MS Edge. It seems that the properties computed by Edge are

Why is my position: absolute div positioned differently in Edge?

Daniel We're trying to put a badge in the corner of the image. For this, we use the parent <div>as a wrapper and <span>inside. So far it works fine for Chrome, Firefox and IE11, but not as expected in MS Edge. It seems that the properties computed by Edge are

How do I control the position of my circles?

Kadia Muhammad So I'm using CodeAvengers to learn how to make games. Recently it taught me how to use onMouseDown and other functions like that. It shows me what properties I can use to make something appear or happen when I click, drag the mouse, or something

How do I quit my position?

ANKIT SHARMA I have an account A from which I assume the role of account B. Since the work is already done, I want to assume the role of Account C. But since only account A can assume the role of account C and not account B, I can't do that. Is there any way t

How do I quit my position?

ANKIT SHARMA I have an account A from which I assume the role of account B. Since the work is already done, I want to assume the role of Account C. But since only account A can assume the role of account C and not account B, I can't do that. Is there any way t

How do I quit my position?

ANKIT SHARMA I have an account A from which I assume the role of account B. Since the work is already done, I want to assume the role of Account C. But since only account A can assume the role of account C and not account B, I can't do that. Is there any way t

How do I control the position of my circles?

Kadia Muhammad So I'm using CodeAvengers to learn how to make games. Recently it taught me how to use onMouseDown and other functions like that. It shows me what properties I can use to make something appear or happen when I click, drag the mouse, or something