Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
Advanced Search
  • 0

Gallery hover effect


charlineca

Question

Hi, I have used the following custom code to give my gallery a hover effect. I have changed the text captions so they are clickable as links.

.gallery-caption {
position: absolute;
top: 0;
left: 0;
background: rgba(0,0,0,0.4); /* overlay color */
height: 100%;
max-width: unset;
padding: 0;
opacity: 0;
}
.gallery-caption-wrapper {
display: flex;
align-items: center; /* center vertically */
justify-content: center; /* center horizontally */
}
.gallery-caption-content {
font-size: 20px !important; /* caption font size */
color: white; /*caption font color */
}
.gallery-strips-item {
position: relative;
}
.gallery-strips-item:hover .gallery-caption {
opacity: 1;
}
.gallery-caption-strips-simple {
transition-delay: 0ms;
}

.gallery-caption a {
color: white; /* color of the caption text */
}

 

However, it is only the text that is clickable. You have to specifically hove over the text to click the link. Is there a possibility to change the code so the whole image is clickable and redirects to the link?

Edited by charlineca
Link to post
  • Answers 1
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

1 answer to this question

Recommended Posts

  • 0

Edit this code

.gallery-caption {
position: absolute;
top: 0;
left: 0;
background: rgba(0,0,0,0.4); /* overlay color */
height: 100%;
max-width: unset;
padding: 0;
opacity: 0;
}

to this

.gallery-caption {
position: absolute;
top: 0;
left: 0;
background: rgba(0,0,0,0.4); /* overlay color */
height: 100%;
max-width: unset;
padding: 0;
opacity: 0;
pointer-events: none /* enable clickable */
}

If it doesn't work, can you share link to page where you added gallery? We can check easier

Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment


×
×
  • Create New...