I'm creating a menu component using angular material, some menu items have submenu and I'm using (mouseover)="menuTrigger.openMenu()" to open the drop down list.
<div class="row">
<div class="col-xl-12 widget-29">
<div class="widget no-bg ">
<div class="widget-body pt-0">
<div id="services" class="owl-carousel ">
<a [matMenuTriggerFor]="menu" #menuTrigger="matMenuTrigger" (mouseover)="menuTrigger.openMenu()" class="item has-shadow">
<div class="devices-item d-flex justify-content-center align-items-center">
<div class="room">{{'menu.reclamations' | translate}}</div>
</div>
<img id="rec" class="img-fluid" src="assets/img/smarthome/plaint.png" alt="...">
</a>
<a [matMenuTriggerFor]="menuu" #menuTriggerr="matMenuTrigger" (mouseover)="menuTriggerr.openMenu()" class="item has-shadow" [routerLink]="['/propositions/all']">
<div class="devices-item d-flex justify-content-center align-items-center">
<div class="room">{{'menu.propositions' | translate}}</div>
</div>
<img class="img-fluid" id="prop" src="assets/img/smarthome/feedback.png" alt="...">
</a>
<a [matMenuTriggerFor]="menuuu" #menuTriggerrr="matMenuTrigger" (mouseover)="menuTriggerrr.openMenu()" class="item has-shadow" [routerLink]="['/sondages/own']">
<div class="devices-item d-flex justify-content-center align-items-center">
<div class="room">{{'menu.participations' | translate}}</div>
</div>
<img class="img-fluid" id="review" src="assets/img/smarthome/review.png" alt="...">
</a>
<a class="item has-shadow" [routerLink]="['/documents']">
<div class="devices-item d-flex justify-content-center align-items-center">
<div class="room">{{'menu.documents' | translate}}</div>
</div>
<img class="img-fluid" src="assets/img/smarthome/file-search.png" alt="...">
</a>
<a class="item has-shadow" data-toggle="modal" data-target="#download">
<div class="devices-item d-flex justify-content-center align-items-center">
<div class="room">{{'menu.appmobiles' | translate}}</div>
</div>
<img class="img-fluid" id="mobile" src="assets/img/smarthome/smartphone.png" alt="...">
</a>
<a class="item has-shadow" [routerLink]="['/renseignement']">
<div class="devices-item d-flex justify-content-center align-items-center">
<div class="room">{{'menu.renseignements' | translate}}</div>
</div>
<img class="img-fluid" id="faq" src="assets/img/smarthome/faq.png" alt="...">
</a>
<a class="item has-shadow" [routerLink]="['/members']">
<div class="devices-item d-flex justify-content-center align-items-center">
<div class="room">{{'menu.lacommune' | translate}}</div>
</div>
<img class="img-fluid" src="assets/img/smarthome/building.png" alt="...">
</a>
</div>
</div>
</div>
</div>
<mat-menu #menu="matMenu" class="dropdown" id="down">
<button class="dropdown-item" [routerLink]="['/plaintes/new']">
<span><i class="la la-plus-circle la-2x"></i> Nouvelle réclamation</span>
</button>
<button class="dropdown-item" [routerLink]="['/plaintes/all']">
<span><i class="la la-eye la-2x"></i> Mes réclamations</span>
</button>
</mat-menu>
<mat-menu #menuu="matMenu" class="dropdown" id="down">
<button class="dropdown-item" [routerLink]="['/plaintes/new']">
<span><i class="la la-plus-circle la-2x"></i>Nouvelle proposition</span>
</button>
<button class="dropdown-item" [routerLink]="['/plaintes/all']">
<span><i class="la la-eye la-2x"></i> Mes propositions</span>
</button>
</mat-menu>
<mat-menu #menuuu="matMenu" [overlapTrigger]="false" class="dropdown" id="down">
<button class="dropdown-item" [routerLink]="['/plaintes/new']">
<span><i class="la la-plus-circle la-2x"></i> participation</span>
</button>
<button class="dropdown-item" [routerLink]="['/sondages/own']">
<span><i class="la la-eye la-2x"></i> mes participations</span>
</button>
</mat-menu>
</div>
when the mouse over a menu item the dropdown opened but won't be closed after that !! even I used (mouseleave)="menuTrigger.closeMenu()" the sub menu appear and disappear in the same time !!!
Related
I have a BootStrap 5 row, the columns of which will always remain the same, even if the content inside of them overflows the column. How do I make it so that when content is larger than the column, the column expands in size?
As you can see, the columns (purple) let the cards inside of them overflow, therefore causing them to collide with other cards. What I want is for the columns to expand when the content inside of them is bound to overflow.
HTML for rows and columns:
<div class="row">
<div class="col">
<h1 class="header">User</h1>
<div class="card card-large border-0 me-1">
<div class="card-body shadow">
<div class="row row-cols-2">
<div class="col" style="text-align: left; margin-left: 15px; margin-top: 16px; width: 50px">
<i class="fa-solid fa-user-pen" style="font-size: 50px;"></i>
</div>
<div class="right-column">
<a class="header row pt-2">Username: </a>
<a class="header row pt-2">Plan: </a>
<a class="header row pt-2">Discord: </a>
<a class="header row pt-2">Date of registration: </a>
<a class="header row pt-2">Used searches: /</a>
</div>
</div>
<div class="mt-2">
<a class="btn shadow text-white me-1" style="background-color: #7289da">Link Discord</a>
<a class="btn btn-secondary shadow text-white me-1">Change password</a>
<a class="btn btn-danger shadow text-white" data-bs-toggle="modal" data-bs-target="#logout">Log out</a>
<div class="modal fade" id="logout" data-bs-backdrop="logout" data-bs-keyboard="false" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" style=" width: 25rem">
<div class="modal-content text-white">
<div class="modal-body" style="background-color: #0e0e0e">
<div class="container">
<div class="row justify-content-center">
<div class="col-1" style="text-align: left; margin-left: 15px; margin-top: 16px; width: 50px">
<i class="fa-solid fa-triangle-exclamation" style="font-size: 50px;"></i>
</div>
<div class="col-8 mt-4">
Are you sure you wish to log out?
</div>
</div>
</div>
</div>
<div class="modal-footer border-0 justify-content-center" style="background-color: #0e0e0e">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
<button data-bs-dismiss="modal" type="button" class="btn btn-danger" #click="deleteCookie()">Log out</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<h1 class="header">Plan</h1>
<div class="card card-large border-0 me-1">
<div class="card-body shadow">
<div class="row row-cols-2">
<div class="col" style="text-align: left; margin-left: 15px; margin-top: 16px; width: 50px">
<i class="fa-solid fa-tag" style="font-size: 50px;"></i>
</div>
<div class="right-column">
<a class="header row pt-2">Plan: </a>
<a class="header row pt-2">Date of Purchase: </a>
<a class="header row pt-2">Date of Expiration: </a>
</div>
</div>
<div class="mt-2">
<a class="btn btn-primary shadow text-white me-1" #click="">Upgrade</a>
<a class="btn btn-danger shadow text-white">Cancel</a>
</div>
</div>
</div>
</div>
<div class="col">
<h1 class="header">API</h1>
<div class="card card-large border-0 me-3">
<div class="card-body shadow">
<div class="row row-cols-2">
<div class="col" style="text-align: left; margin-left: 15px; margin-top: 16px; width: 50px">
<i class="fa-solid fa-code" style="font-size: 50px;"></i>
</div>
<div class="right-column">
<a class="header row pt-2">Used searches: /</a>
</div>
</div>
<div class="mt-2">
<a class="btn btn-secondary shadow text-white me-1 disabled">API docs</a>
<a class="btn btn-secondary shadow text-white me-1" onclick="">Copy API key</a>
<a class="btn btn-secondary shadow text-white">Regenerate API key</a>
</div>
</div>
</div>
</div>
</div>
Add col-lg-4 in column row like this
<div class="row">
<div class="col-lg-4">
//content
</div>
<div class="col-lg-4">
//content
</div>
<div class="col-lg-4">
//content
</div>
</div>
For more information, please visit this link : https://getbootstrap.com/docs/5.2/layout/columns/#how-they-work
I want to make Vertical bootstrap tabs but when I tried to use the code from bootstrap 5 docs I faced a problem when opening the tabs as you can see in the screenshot the tabs are showing next to each other when I switch between them so what I'm missing in this
]
code
<div class="d-flex align-items-start center rounded" style="direction: rtl;">
<div class="nav flex-column nav-pills me-3" id="v-pills-tab" role="tablist" aria-orientation="vertical">
<button class="btn btn-lg btn-primary" id="v-pills-home-tab" data-bs-toggle="pill" data-bs-target="#v-pills-home"
type="button" role="tab" aria-controls="v-pills-home" aria-selected="true">Home</button>
<button class="btn btn-lg btn-primary dflex" id="v-pills-profile-tab" data-bs-toggle="pill"
data-bs-target="#v-pills-profile" type="button" role="tab" aria-controls="v-pills-profile"
aria-selected="false">Store</button>
</div>
<div class="tab-content" id="v-pills-tabContent">
<div class="tab-pane fade show active" id="v-pills-home" role="tabpanel" aria-labelledby="v-pills-home-tab">
<div class="container contain bg-light rounded">
<div class="row" style="direction:rtl;">
<h4 class="title" >Home</h4><br>
</div><hr />
<div class="row" style="direction:rtl;">
<div class="card cashIncom shadow-lg p-3 mb-5 bg-white rounded">
<div class="card-body" style="width:750px;">
<div class="mb-1">
<div class="d-inline-flex align-items-center">
<span class="spanIncome">إجمالي الأرباح :</span>
<span class="spanValue" id="spanIncomeValue">500$</span>
<i class="fa-solid fa-credit-card iconstate"></i>
</div>
</div>
</div>
</div>
</div>
<div class="row" style="direction:rtl;">
<div class="card cashIncom shadow-lg p-3 mb-5 bg-white rounded">
<div class="card-body" style="width:750px;">
<div class="mb-1">
<div class="d-inline-flex align-items-center">
<span class="spanIncome">المصروفات :</span>
<span class="spanValuespent" id="spanIncomeValue">500$</span>
<i class="fa-solid fa-dollar-sign spenticon"></i>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
I added 2 bootstrap 5 carousels on the same page, added unique ID to each of them, but sadly the second carousel mixes photos with the first carousel. It takes 2 photos from the previous slide. Adding unique ID's to each carousel didn't change the situation.
Is there a solution to this?
I checked also this post but it didn't help:
How to place two bootstrap carousels in the same page?
<!-- Bootstrap carousel 1 -->
<div class="container text-center my-3 mb-5">
<div class="row mx-auto my-auto justify-content-between">
<div id="Carousel-1" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/person1.jpg" class="img-fluid">
</div>
<div class="card-img-overlay"><strong>John Smith</strong>
<p class="mt-0 me-2" style="font-size: 13px;">Administration</p>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/person2.jpg" class="img-fluid">
</div>
<div class="card-img-overlay"><strong>Sarah Smith</strong>
<p class="mt-0 me-2" style="font-size: 13px;">Finance</p>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/person3.jpg" class="img-fluid">
</div>
<div class="card-img-overlay"><strong>Roger Kensinghton</strong>
<p class="mt-0 me-2" style="font-size: 13px;">Security</p>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/person4.jpg" class="img-fluid">
</div>
<div class="card-img-overlay"><strong>Kelly Parker</strong>
<p class="mt-0 me-2" style="font-size: 13px;">Design</p>
</div>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev bg-transparent w-aut" href="#Carousel-1" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</a>
<a class="carousel-control-next bg-transparent w-aut" href="#Carousel-1" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</a>
</div>
</div>
</div>
<!-- Bootstrap carousel 2 -->
<div class="container text-center my-3 mb-5 carousel2">
<div class="row mx-auto my-auto justify-content-between">
<div id="Carousel-2" class="carousel slide" data-bs-ride="carousel">
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/woman1.jpg" class="img-fluid">
</div>
<div class="card-img-bottom"><strong>Jane Dow</strong>
<p class="mt-0 me-2" style="font-size: 13px;">CEO AXA Group</p>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/man1.jpg" class="img-fluid">
</div>
<div class="card-img-bottom"><strong>Dave Johnson</strong>
<p class="mt-0 me-2" style="font-size: 13px;">Marketing Manager Johnson's & Co</p>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/man2.jpg" class="img-fluid">
</div>
<div class="card-img-bottom"><strong>Roger Smith</strong>
<p class="mt-0 me-2" style="font-size: 13px;">CEO Hi-Tech Intl.</p>
</div>
</div>
</div>
</div>
<div class="carousel-item">
<div class="col-md-4">
<div class="card">
<div class="card-img">
<img src="./images/woman2.jpg" class="img-fluid">
</div>
<div class="card-img-bottom"><strong>Diana Russel</strong>
<p class="mt-0 me-2" style="font-size: 13px;">Manager Creativity Hub</p>
</div>
</div>
</div>
</div>
</div>
<a class="carousel-control-prev bg-transparent w-aut" href="#Carousel-2" role="button" data-bs-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
</a>
<a class="carousel-control-next bg-transparent w-aut" href="#Carousel-2" role="button" data-bs-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
</a>
</div>
</div>
</div>
let items = document.querySelectorAll('.carousel .carousel-item')
items.forEach((el) => {
const minPerSlide = 3
let next = el.nextElementSibling
for (var i=1; i<minPerSlide; i++) {
if (!next) {
// wrap carousel by using first child
next = items[0]
}
let cloneChild = next.cloneNode(true)
el.appendChild(cloneChild.children[0])
next = next.nextElementSibling
}
})
because you use .carousal selector and class is present in both carousals use ids instead of class #Carousel-1 or #Carousel-2
let items = document.querySelectorAll('#Carousel-1 .carousel-item')
I don't have any experience with html, so I am using a free template for my website that uses fadeInUp to display images. When the page is first loaded one section overlaps the images on top of each other and even on top of a contact form at the bottom of the page. Shown here:
Overlapping Images
This persists until the page is reloaded, then it all works like it's supposed to. I've tried for days to find a solution, but with my extremely limited knowledge, it's hard to even know what to look for. Here is what it should look like and what it does look like once the page is reloaded:
Correct Layout
I'm hoping someone can help me figure out why this is happening. Happens in Safari, Chrome, and Edge and each time it is fixed when I reload.
Here is the code from the free template (modified by me to add descriptions and the correct images):
<!-- Projects Start -->
<div class="container-xxl py-5">
<div class="container">
<div class="section-title text-center">
<h1 class="display-5 mb-5">Portfolio Samples</h1>
</div>
<div class="row g-4 portfolio-container">
<div class="col-lg-4 col-md-6 portfolio-item first wow fadeInUp" data-wow-delay="0.1s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/ShojiLamp.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/ShojiLamp.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale</p>
<h4 class="mb3">Shoji Lamp</h4>
<p>Japanese inspired shoji lamp in walnut with maple panels. Castle joinery throughout.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item second wow fadeInUp" data-wow-delay="0.3s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/ChessBoard.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/ChessBoard.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">Custom Woodworking</p>
<h4 class="mb3">Chess Board</h4>
<p>Simple chessboard made from 19mm thick walnut with 4mm thick curly maple inlays. </p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item first wow fadeInUp" data-wow-delay="0.5s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/3dCuttingBoard.jpeg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/3dCuttingBoard.jpeg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale</p>
<h4 class="mb3">Bella Cutting Board</h4>
<p>50mm thick end grain cutting board crafted in walnut and hard maple. Featuring a 3D effect.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item second wow fadeInUp" data-wow-delay="0.1s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/TableLamp.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/TableLamp.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale - 2 available</p>
<h4 class="mb3">Riley Table Lamp</h4>
<p>A tilted shade and bent body offers a twist on a tradional table lamp with the cord threaded through the body. Crafted in walnut.</p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item first wow fadeInUp" data-wow-delay="0.3s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/EntrywayTable.jpg" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/EntrywayTable.jpg" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">For Sale</p>
<h4 class="mb3">Entryway Table</h4>
<p>A delicate live edge entryway table in spalted ash with walnut bowtie inlays. Cracks filled with black epoxy. Box joinery on the apron. </p>
</div>
</div>
</div>
<div class="col-lg-4 col-md-6 portfolio-item second wow fadeInUp" data-wow-delay="0.5s">
<div class="rounded overflow-hidden">
<div class="position-relative overflow-hidden">
<img class="img-fluid w-100" src="img/GearShiftKnob.png" alt="">
<div class="portfolio-overlay">
<a class="btn btn-square btn-outline-light mx-1" href="img/GearShiftKnob.png" data-lightbox="portfolio"><i class="fa fa-eye"></i></a>
<a class="btn btn-square btn-outline-light mx-1" href=""><i class="fa fa-link"></i></a>
</div>
</div>
<div class="border border-5 border-light border-top-0 p-4">
<p class="text-primary fw-medium mb-2">Custom Woodworking</p>
<h4 class="mb3">Gear Shift Knob </h4>
<p>A custom gear shift knob commisioned in support of a loved one's fight with stomach cancer. Crafted in walnut with epoxy inlay.</p>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Projects End -->
I made three blocks – using the CARD class in bootstrap. That worked well. Now I'd like to add a footer (or just a div) to the card that allows to "Show/Hide Details".
I tried 10 different ways and the cards always "break" for some reason. I have the code that works for the cards but without the collapsing
The goal is to have the last 3 lines collapsing, while the "Show payment schedule" changes to "Hide payment schedule".
Who knows how to get there? Where to put the div class for the collapsing without breaking the card?
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<!-- Wrapper for Cards -->
<div class="row mx-n2">
<div class="col-sm-6 col-md-4 px-2 mb-3 mb-md-0">
<!-- Card 1 -->
<a class="card h-100 transition-3d-hover" href="#">
<img class="card-img-top" src="../../assets/img/480x220/monthly.gif" alt="Monthly Animation">
<div class="card-body">
<h4>Monthly</h4>
<p class="font-size-1 text-body mb-0">You will be charged every month the amount of</p>
<h3 class="text-center font-weight-bold text-black-50 mb-0 mt-4">USD 43</h3>
</div>
<hr/>
<!-- Collapsing Footer -->
<div class="card-footer border-0 pt-0">
<span class="font-size-1 text-black-50">Show payment schedule</span>
<div class="row pt-2">
<div class="col">
<span class="today font-size-1 text-black-50" data-toggle="tooltip" data-html="true" id="today">Today</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 43</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">June 2020</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 43</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">July 2020</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 43</span>
</div>
</div>
</div>
<!-- End Collapsing Footer -->
</a>
<!-- End Card 1 -->
</div>
<div class="col-sm-6 col-md-4 px-2 mb-3 mb-md-0">
<!-- Card 2 -->
<a class="card h-100 transition-3d-hover" href="#">
<img class="card-img-top" src="../../assets/img/480x220/quarterly.gif" alt="Quarterly Animation">
<div class="card-body">
<h4>Quarterly</h4>
<p class="font-size-1 text-body mb-0">You will be charged every third month the amount of</p>
<h3 class="text-center font-weight-bold text-black-50 mb-0 mt-4">USD 102</h3>
</div>
<hr/>
<!-- Collapsing Footer -->
<div class="card-footer border-0 pt-0">
<span class="font-size-1 text-black-50 ">Show payment schedule</span>
<div class="row pt-2">
<div class="col">
<span class="today font-size-1 text-black-50" data-toggle="tooltip" data-html="true" id="today">Today</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 102</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">July 2020</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">July 2020</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">July 2020</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 43</span>
</div>
</div>
</div>
<!-- End Collapsing Footer -->
</a>
<!-- End Card 2 -->
</div>
<div class="col-sm-6 col-md-4 px-2 mb-3 mb-md-0">
<!-- End Card 3 -->
<a class="card h-100 transition-3d-hover" href="#">
<img class="card-img-top" src="../../assets/img/480x220/yearly.gif" alt="Yearly Animation">
<div class="card-body">
<h4>Annually</h4>
<p class="font-size-1 text-body mb-0">You will be charged once every year the amount of</p>
<h3 class="text-center font-weight-bold text-black-50 mb-0 mt-4">USD 408</h3>
</div>
<hr/>
<!-- Collapsing Footer -->
<div class="card-footer border-0 pt-0">
<span class="font-size-1 text-black-50">Show payment schedule</span>
<div class="row pt-2">
<div class="col">
<span class="today font-size-1 text-black-50" data-toggle="tooltip" data-html="true" id="today">Today</span> </div>
<div class="col">
<span class="font-size-1 text-black-50">USD 408</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">April 2021</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 408</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">April 2022</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 408</span>
</div>
</div>
</div>
<!-- End Collapsing Footer -->
</a>
<!-- End Card 3 -->
</div>
</div>
<!-- End Wrapper for Cards -->
Like this? for more info, visit https://getbootstrap.com/docs/4.4/components/collapse/
Explanation
I added
data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample"
to your span so, it works like collapsable toggler and added root div with
class="collapse show" id="collapseExample"
to your three items so only one div can collapse.
document.querySelectorAll('.change_text').forEach(cur => {
cur.addEventListener('click', e => {
const target = e.target;
if (target.textContent === 'Show payment schedule') {
target.textContent = 'Hide payment schedule';
} else {
target.textContent = 'Show payment schedule';
}
})
});
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<div class="row mx-n2">
<div class="col-sm-6 col-md-4 px-2 mb-3 mb-md-0">
<!-- End Card 3 -->
<div class="card h-100 transition-3d-hover" href="#">
<img class="card-img-top" src="../../assets/img/480x220/yearly.gif" alt="Yearly Animation">
<div class="card-body">
<h4>Annually</h4>
<p class="change_text font-size-1 text-body mb-0">You will be charged once every year the amount of</p>
<h3 class="text-center font-weight-bold text-black-50 mb-0 mt-4">USD 408</h3>
</div>
<hr/>
<!-- Collapsing Footer -->
<div class="card-footer border-0 pt-0">
<a class="change_text font-size-1 text-black-50" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">Show payment schedule</a>
<div class="collapse show" id="collapseExample">
<div class="row pt-2">
<div class="col">
<span class="today font-size-1 text-black-50" data-toggle="tooltip" data-html="true" id="today">Today</span> </div>
<div class="col">
<span class="font-size-1 text-black-50">USD 408</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">April 2021</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 408</span>
</div>
</div>
<div class="row">
<div class="col">
<span class="font-size-1 text-black-50" data-toggle="tooltip" data-html="true" title="placeholder">April 2022</span>
</div>
<div class="col">
<span class="font-size-1 text-black-50">USD 408</span>
</div>
</div>
</div>
</div>
<!-- End Collapsing Footer -->
</div>
<!-- End Card 3 -->
</div>
</div>
It looks like your collapsing section is just another card element nested in the parent card element. According to the docs, Bootstrap has a Collapse element and it's used in conjunction with data-toggle="collapse" when the element triggering the animation is a link. When the element triggering the animation is a div, like in your case, you have to give it the class collapse.
The docs show an examples for both. Trying something like the second part:
<p>
<a class="btn btn-primary" data-toggle="collapse" href="#collapseExample" role="button" aria-expanded="false" aria-controls="collapseExample">
Link with href
</a>
<button class="btn btn-primary" type="button" data-toggle="collapse" data-target="#collapseExample" aria-expanded="false" aria-controls="collapseExample">
Button with data-target
</button>
</p>
<div class="collapse" id="collapseExample">
<div class="card card-body">
Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident.
</div>
</div>