My code here isn’t working…any other idea as to what to to put in as the if statement’s condition? Any help is appreciated greatly. Thanks!
HTML:
<img class="image image1" src="images/spongebob1.jpg" />
CSS:
.image {
height: 94%;
margin: 0 auto;
position: absolute;
animation: moveSlider 5s 1;
-webkit-animation: moveSlider 5s 1;
}
@keyframes moveSlider {
from {left:0px;}
to {left:200px;}
}
@-webkit-keyframes moveSlider {
from {opacity:0;}
to {opacity:1;}
}
JS:
$(document).ready(function() {
$(".image2, .image3, .image4, .image5").hide();
if ($(".image1").css('opacity') === '1') {
$(".image1").hide();
}
});
The issue seems to be you’re using 1 as a string. === will not convert the string to an integer
try === 1 instead of ‘1’