Accidental delay upon mouse exit

Upon hovering over, the transition immediately begins, but there is a delay of about 300ms before the reverse transition starts upon hovering off. (https://example.com)

<div id="isa-hover-gallery">

<a href="https://example-link.com">
<div class="isa-image" style="background-image:url('https://example-image.jpg')">
<div class="slide-text">
<p><b>Text Here</b></p>
<p>Additional text goes here...</p>
</div>
</div>
</a>

</div>

#isa-hover-gallery {
  display: flex;
  flex-wrap: wrap;
}
#isa-hover-gallery .isa-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 215px;
  min-width: 320px;
  margin: 0 24px 24px 0;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  cursor: pointer;
}
#isa-hover-gallery .isa-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0,0,0,0);
  transition: 300ms ease-in;
}
#isa-hover-gallery .isa-image > span {
  position: relative;
  z-index: 11;
  opacity: 0;
  color: #ffffff;
  font-size: 20px;
  font-family: 'Open Sans', sans-serif;
  transition: 300ms ease-in;
}
#isa-hover-gallery .isa-image .slide-text {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 4px 6px;
  background-color: rgba(0,0,0,0.8);
  color: #ffffff;
  z-index: 11;
}
#isa-hover-gallery .isa-image .slide-text p:first-child {
  padding-bottom: 0;
}
#isa-hover-gallery .isa-image .slide-text p:last-child {
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  transition: 600ms ease-in;
}
#isa-hover-gallery .isa-image:hover::after {
 background-color: rgba(0,0,0,0.6);
}
#isa-hover-gallery .isa-image:hover > span {
  opacity: 1;
}
#isa-hover-gallery .isa-image:hover .slide-text p:last-child {
  max-height: 1000px;
  margin: auto;
  padding: auto;
}

Various attempts with different transition speeds and disabling transitions on other elements have been unsuccessful in resolving the issue.

Answer №1

The reason for this issue is due to the excessive value set for the max-height property in the animation. To resolve this, simply reduce the value of max-height:

#isa-hover-gallery {
  display: flex;
  flex-wrap: wrap;
}

#isa-hover-gallery .isa-image {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 215px;
  min-width: 320px;
  margin: 0 24px 24px 0;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  cursor: pointer;
}

#isa-hover-gallery .isa-image::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  background-color: rgba(0, 0, 0, 0);
  transition: 300ms ease-in;
}

#isa-hover-gallery .isa-image>span {
  position: relative;
  z-index: 11;
  opacity: 0;
  color: #ffffff;
  font-size: 20px;
  font-family: 'Open Sans', sans-serif;
  transition: 300ms ease-in;
}

#isa-hover-gallery .isa-image .slide-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right:0;
  padding: 4px 6px;
  background-color: rgba(0, 0, 0, 0.8);
  color: #ffffff;
  z-index: 11;
}

#isa-hover-gallery .isa-image .slide-text p:first-child {
  padding-bottom: 0;
}

#isa-hover-gallery .isa-image .slide-text p:last-child {
  max-height: 0;
  overflow: hidden;
  margin: 0;
  padding: 0;
  transition: 600ms ease-in;
}

#isa-hover-gallery .isa-image:hover::after {
  background-color: rgba(0, 0, 0, 0.6);
}

#isa-hover-gallery .isa-image:hover>span {
  opacity: 1;
}

#isa-hover-gallery .isa-image:hover .slide-text p:last-child {
  max-height: 100px;
  margin: auto;
  padding: auto;
}
<div id="isa-hover-gallery">

  <a href="https://febc.org/indonesia">
    <div class="isa-image" style="background-image:url('https://febc2017.wpengine.com/wp-content/plugins/justified-image-grid/timthumb.php?src=https%3A%2F%2Ffebc2017.wpengine.com%2Fwp-content%2Fuploads%2FEmail-1-Pakistan-Listener-Story_banner-image-900x600.jpg&h=560&w=798&q=45&f=.jpg')">
      <div class="slide-text">
        <p><b>Sharing His Faith in Pakistan</b></p>
        <p>Anam* was given an extraordinary opportunity after he came to faith in Christ…He was asked to preach from the Bible in the mosque his father ran…</p>
      </div>
    </div>
  </a>

</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

Text scrolls - items are shown all at once

I've been experimenting with creating moving/scrolling text. After some trial and error, I've managed to achieve this effect. If you're interested, you can check out the code on CODEPEN. The issue that's currently bothering me is rel ...

Using Google-Prettify with AngularJS

I have been attempting to implement Google Prettify in my AngularJS project. It seems to be functioning correctly on the main page, but once I navigate to another route using Angular (after ng-view), it stops working properly. You can check out the plunker ...

Desktop media queries are functioning properly, yet experiencing issues on mobile devices

I've come across this same question multiple times, but the solutions I've found so far haven't been helpful. My media queries are working perfectly on desktop, but they don't seem to take effect on three different android devices. It&a ...

Differences in the way websites scroll on Chrome compared to Safari and Firefox

Currently, I am in the process of developing a rendering system for my application that extracts objects from a collection and processes them through JavaScript templates to generate additional children as the user scrolls through the page. The system is d ...

Exploring the differences between Zurb Foundation 6's app.scss and _settings.scss files

Can you explain the distinction between app.scss and _settings.scss when using Zurb Foundation 6? ...

Stop the Nav bar item from collapsing

Alright, let's talk about the scenario: The situation is that I have a basic, plain, nav nav-tabs navigation bar with a few elements and a rightmost item (with pull-right) positioned as an <li> element which includes a dropdown. As the window ...

Error with adaptable menu

I am attempting to develop a responsive menu similar to the Bootstrap nav bar using only CSS. I have managed to get the functionality working, but the positioning of the menu grabber is incorrect and I'm unsure how to correct it. The grabber should al ...

What are the steps for adding a JSON file to a GitHub repository?

Could someone lend a hand with my GitHub issue? I recently uploaded my website to a GitHub repository. The problem I'm facing is that I have a JSON file containing translations that are being processed in JavaScript locally, and everything works fine ...

I'm struggling to determine the correct path to use in the background-image: url(); CSS property to display a specific image within a Vue.js project

Currently, I am working on a Vue.js project and this is the structure of my file tree (showing only relevant folders and files): root src assets image.jpg components header.vue index.html Within the header.v ...

Collapsed navbars in Bootstrap 5 fail to display properly in a two-column format

Looking to create a responsive Bootstrap 5 navbar that collapses at the md breakpoint and displays navlinks in two columns upon collapse. Currently facing an issue where the navbar remains expanded and the toggle button fails to work after hitting the br ...

Adjustable dimensions and proportions for the following image

I'm currently working on a blog page using next.js and I've encountered an issue with displaying images. Each post has a main image of varying dimensions and aspect ratios, making it difficult to maintain consistency when scaling for smaller scre ...

How can I emphasize only a portion of a word in ReactJS and Material UI?

I am attempting to replicate this design: https://i.stack.imgur.com/H8gKF.png So far, this is what I have been able to achieve: https://i.stack.imgur.com/TJXXb.png My project utilizes Material UI and ReactJS. Below is a snippet of the code: bodyTitle: { ...

drag and drop feature paired with additional textarea below

query 1: How can I make the bottom-left textarea move together with the top-left textarea when I drag it down? query 2: What is the solution to prevent the left-bottom textarea from moving when I drag down the top-right textarea? http://jsfiddle.net/4BX6 ...

The background image is cropped, causing a scroll bar to be added

I've been attempting to add a background image to my HTML using the code below: body { margin: 0; background: url('images/lightning.jpg') no-repeat center center fixed; background-size: cover; -webkit-background-size: cover; -mo ...

Is there a way to ensure that when displaying information boxes with Bootstrap, the inputs do not get misplaced or shuffled to the wrong location

I have been working on a form that needs to display an alert: When clicking the button next to the input control, an alert should appear. Although the alert is showing correctly, the input controls are shifting to the wrong position afterwards: The desir ...

generate a customized synopsis for users without storing any data in the database

In order to provide a summary of the user's choices without saving them to the database, I want to display it in a modal that has already been created. Despite finding some sources online, none of them have worked for me so far. Below is my HTML: &l ...

Issue with Bootstrap modal not dismissing when using click function

This is my custom function and div. When I click the function, it executes successfully but the modal window remains visible. <script type="text/javascript> $(document).ready(function () { $("#btnRespuesta").click(function () { //al ...

Align the logo in the center of the navbar with items placed on either side

Looking for a way to center my brand logo within my navbar with menu items positioned around it? Preferably without the use of javascript? I've tried different methods, including adjusting the Bootstrap navbar styling, but haven't found a perfect ...

Mastering the fundamentals of integrating/augmenting a fresh template in Umbraco

Let me be completely honest. Umbraco is unlike any other CMS I have worked with before. I am currently struggling to grasp the proper method of creating a Template and integrating it into Umbraco. How exactly can I add a template? I am making changes to t ...

Align navigation bar using Angular Material

Trying to center my navbar has been a struggle for me. I attempted using 'layout-align='space-between center' but it's not taking up 100% width and is acting more like an inline element. I've been following the documentation close ...