Struggling with using the .addClass
function on certain <div>
tags. It seems to work fine on some, but not at all on others. I'm thinking that specific attributes within the class might be affecting it, such as position:relative;
versus absolute, or already having opacity set in the class.
The class I am trying to add simply sets opacity to 0.
SCRIPT
$(".ico_popup_container").addClass("ico_off");
CLASS TO BE ADDED:
.ico_off {
opacity:0;
}
When added to this tag, it works perfectly:
.ico_container {
z-index:96;
display:none;
width: 100%;
height:100%;
background-color:transparent;
background-size:cover;
background-position:100% 20%;
background-image:url(../images/ico/ico_back_01.jpg);
background-repeat:no-repeat;
}
However, when added to this tag, it does NOT work:
.ico_popup_container {
z-index:95;
display: none;
position:absolute;
width: 60%;
height:0%;
top:0;
bottom: 0;
left: 0;
right: 0;
margin: auto;
opacity:1;
background-color:transparent;
}
I've tried removing the opacity and position properties to match the settings of the working tag, but still no luck. Perhaps it has something to do with parent containers?