Is there a way to use the if statement of JavaScript to hide CSS elements based on other CSS styles? I'm working in SharePoint and I'm applying some CSS codes to an image I have with some text with background in top of it. This image has a hover/animation effect and I would like to hide the text and background when the hover effect begins. Something like if(image3.opacity="1") then(h2, h2 span, h2 span.spacer)=hide. I'm a total newbie in javascript, so I would really appreciate your help!
the CSScode I've made so far is the next one:
#image3 {
opacity: 0.4;
filter: alpha(opacity=40);
box-shadow: 0px 0px 15px grey;
alt: missing;
transition-property: opacity;
transition-duration: .2s;
}
#image3:hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
.image {
position: relative;
width: 100%;
}
h2 {
position: absolute;
bottom: 50px;
left: 5px;
width: 100%;
}
h2 span {
color: white;
font: bold 24px/45px Helvetica, Sans-Serif;
letter-spacing: 0px;
background: rgb(0, 0, 0);
background: rgba(0, 0, 0, 0.6);
padding: 9px;
}
h2 span.spacer {
padding:0 5px;
background: rgba(0, 0, 0, 0);
}