I have been trying to hide this overflow and I am currently stumped. I am a novice when it comes to creating websites. I was interested in how a parallax works, so I downloaded it from https://codepen.io/maja127/pen/VwwOvpv and tried using it in a website template. I tried hiding the using the regular overflow: hidden; but it did not work. I tried adding relative container and an absolute with different heights, but I can't seem to get it.
$(window).bind('scroll',function(e){
parallaxScroll();
});
function parallaxScroll(){
var scrolled = $(window).scrollTop();
$('.layer-1').css('top',(0+(scrolled*.25))+'px');
$('.layer-2').css('top',(0+(scrolled*.5))+'px');
$('.layer-3').css('top',(0-(scrolled*0))+'px');
$('.rock-1').css('top',(400-(scrolled*.8))+'px');
$('.rock-2').css('top',(200-(scrolled*.6))+'px');
$('.rock-3').css('top',(500-(scrolled*.4))+'px');
$('.rock-4').css('top',(600-(scrolled*.5))+'px');
$('.rock-5').css('top',(600-(scrolled*.7))+'px');
$('.rock-6').css('top',(400-(scrolled*.7))+'px');
$('.rock-7').css('top',(600-(scrolled*.5))+'px');
$('.rock-8').css('top',(200-(scrolled*.2))+'px');
$('.rock-9').css('top',(200-(scrolled*.4))+'px');
}
* {
box-sizing: border-box;
}
.iframe-container2{
position: relative;
width: 100%;
padding-bottom: 50%;
height: 0;
}
.iframe-container .content{
position: absolute;
top:0;
left: 0;
width: 100%;
height: 100%;
}
.layer {
position: absolute;
background-position: center;
bottom: 0;
left: 0;
width: 100vw;
height: 100vh;
}
.layer-1 {
background-image: url("../images/parralax/layer_w1.png");
margin-top: 8%;
overflow: hidden;
background-repeat: no-repeat;
z-index: -3;
}
.layer-2 {
background-image: url("../images/parralax/layer_t1.png");
background-repeat: no-repeat;
overflow: hidden;
z-index: -2;
}
.layer-3 {
background-image: url("../images/parralax/layer_l.png");
margin-top: 21em;
overflow: hidden;
background-repeat: no-repeat;
z-index: -1;
}
<!-- parallax -->
<div class="iframe-container2">
<div class="content">
<div class="background">
<div class="layer layer-1"></div>
<div class="layer layer-2"></div>
<div class="layer layer-3"></div>
</div>
</div>
</div>
<!-- partial -->
<script src='https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js'></script><script src="./script.js"></script>