charlineca Posted March 25, 2021 Posted March 25, 2021 (edited) 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 March 25, 2021 by charlineca
tuanphan Posted March 29, 2021 Posted March 29, 2021 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 Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
margmorg Posted October 19, 2021 Posted October 19, 2021 I used this code above, and it's working so far, but now I need to add padding or change the max width so it doesn't go all the way to the edge. Here's my site: https://glockenspiel-mandolin-ltjl.squarespace.com/config/design pw: peanut I'd also like to add buttons below the captions if possible...
tuanphan Posted October 21, 2021 Posted October 21, 2021 On 10/20/2021 at 2:25 AM, margmorg said: I used this code above, and it's working so far, but now I need to add padding or change the max width so it doesn't go all the way to the edge. Here's my site: https://glockenspiel-mandolin-ltjl.squarespace.com/config/design pw: peanut I'd also like to add buttons below the captions if possible... Hi, Where is gallery? Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
recoveringlazyholic Posted February 23, 2023 Posted February 23, 2023 (edited) @tuanphan I've used this code as well and I'm wondering if there is a way to change the hover delay? It takes a good couple of seconds mousing over to see the hover effect. Edited February 23, 2023 by recoveringlazyholic
tuanphan Posted February 26, 2023 Posted February 26, 2023 On 2/24/2023 at 2:38 AM, recoveringlazyholic said: @tuanphan I've used this code as well and I'm wondering if there is a way to change the hover delay? It takes a good couple of seconds mousing over to see the hover effect. add transition to the 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; pointer-events: none /* enable clickable */ transition: all 0.1s !important; } Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!)
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment