I have a wordpress site, on it I have a row of app like icons. When you hover each button a description should appear underneath in an area created. As they are not in the same div I need to use JavaScript to get this to work but I have tried everything and nothing is working.
I added this to css, the class is of the text to hide.
#installation-popup {
display: none;
}
and have tried multiple Java ways to get this to appear including these 3 ways:
var element = document.getElementsByClassName('.hvr-grow')[0];
element.addEventListener("mouseover",function(){
document.getElementsByClassName('#installation-popup')[0].style.display = "block";
});
element.addEventListener("mouseout",function(){
document.getElementsByClassName('#installation-popup')[0].style.display = "none";
});
$(".hvr-grow").hover(
function() {
$('#installation-popup').show()
},
function() {
$('#installation-popup').hide()
}
);
$(document).ready(function () {
$(document).on('mouseenter', '.hvr-grow', function () {
$(this).find("#installation-popup").show();
}).on('mouseleave', '.hvr-grow', function () {
$(this).find("#installation-popup").hide();
});
});
How can I do this?