Yes! It was super helpful, I've customizing most of my website referencing that link and the forums even though I'm completely new to css and js.
I found the code below on a previous forum post about Hovering and Images, and I've been trying to modify it below for my website. I think the big problem I keep running into when modifying this code is that when I try to modify the hoverFolio-links and replace it with my project titles/links in my menu I probably just don't have the code grammar right so it breaks :'(
I've been trying to code it so my project titles in the menu are in their own a classes so they can be called out but I'm not too sure what I'm doing wrong...
Custom HTML at top:
<script>
// Hover Folio
function hover_folio() {
var wrapper = $('.hoverFolio');
if (!wrapper[0] || wrapper[0].hoverFolio) {
return;
}
wrapper[0].hoverFolio = true;
var images = wrapper.find(".hoverFolio-image");
var links = wrapper.find(".hoverFolio-link");
var currentImage;
links.each(function (index) {
$(this).on("mouseenter", function () {
if (currentImage) {
currentImage.hide();
}
currentImage = images.eq(index);
if (currentImage) {
currentImage.show();
}
});
});
links.on("mouseleave", function () {
if (currentImage) {
currentImage.hide();
}
});
}
$(document).ready(function() {
hover_folio();
// Every time a new page is shown, try to initialize the hoverFolio effect
window.laytheme.on('newpageshown', hover_folio)
});
}(jQuery))
</script>
Custom CSS:
.hoverFolio {
/*basic styling for your text object*/
margin: auto !important;
}
.hoverFolio-links {
/*that’s the wrapper for the links which also defines the image height in relation to your text block*/
position: relative;
z-index: 1;
padding: 5vw 0;
}
.hoverFolio .hoverFolio-images img.hoverFolio-image {
/*that’s your image positioning*/
position: absolute;
object-fit: contain;
width: auto;
height: 100%;
top: 0;
left: 50%;
bottom: 0;
transform: translateX(-50%);
display: none;
}
Hover golio (gridder Content):
Paste into code-view of the gridder Element
<p class="hoverFolio-links">
<a class="hoverFolio-link" href="https://linktosomewhere.com">Lorem</a>,
<a class="hoverFolio-link" href="https://linktosomewhere.com">Ipsum</a>,
<a class="hoverFolio-link" href="https://linktosomewhere.com">Dolor</a>,
<a class="hoverFolio-link" href="https://linktosomewhere.com">Sit</a>,
<a class="hoverFolio-link" href="https://linktosomewhere.com">Amet</a>,
</p>
<div class="hoverFolio-images">
<img class="hoverFolio-image" src="https://sourcetoyourimage.com"/>
<img class="hoverFolio-image" src="https://sourcetoyourimage.com"/>
<img class="hoverFolio-image" src="https://sourcetoyourimage.com"/>
<img class="hoverFolio-image" src="https://sourcetoyourimage.com"/>
<img class="hoverFolio-image" src="https://sourcetoyourimage.com"/>
</div>
}