Search code examples
.netoverflowhiddenperfect-scrollbar

Overflow hidden is not working with slideshow


This is creating the slideshow, but with a scrollbar and small white gap at bottom. I have placed it inside A DIV with relative and overflow hidden as I found on another topic but it still shows the scrollbar. I am assuming there is something else I need to do but can't seem to find the relevant topic here to match exactly what I am doing.

<style>
    ol,ul {
    list-style:none;
}
.cb-slideshow,
.cb-slideshow:after { 
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0px;
    left: 0px;
    z-index: 0; 
    overflow:hidden !important;
}
.cb-slideshow:after { 
    content: '';
    background: transparent url(../images/pattern.png) repeat top left; 
}
.cb-slideshow li span { 
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0px;
    left: 0px;
    color: transparent;
    background-size: cover;
    background-position: 50% 50%;
    background-repeat: none;
    opacity: 0;
    z-index: 0;
    animation: imageAnimation 30s linear infinite 0s; 
}
.cb-slideshow li div { 
    z-index: 1000;
    position: absolute;
    top: 100px;
    left: 0px;
    width: 100%;
    text-align: center;
    opacity: 1;
    color: #fff;
    animation: titleAnimation 30s linear infinite 0s; 
}
.cb-slideshow li div h3 { 
    font-family: 'BebasNeueRegular', 'Arial Narrow', Arial, sans-serif;
    font-size: 240px;
    padding: 0;
    line-height: 200px; 
}

.cb-slideshow li:nth-child(1) span { 
    background-image: url(../images/1a.jpg) 
}
.cb-slideshow li:nth-child(2) span { 
    background-image: url(../images/2a.jpg);
    animation-delay: 6s; 
}
.cb-slideshow li:nth-child(3) span { 
    background-image: url(../images/3a.jpg);
    animation-delay: 12s; 
}
.cb-slideshow li:nth-child(4) span { 
    background-image: url(../images/4a.jpg);
    animation-delay: 18s; 
}
.cb-slideshow li:nth-child(5) span { 
    background-image: url(../images/5a.jpg);
    animation-delay: 24s; 
}


.cb-slideshow li:nth-child(2) div { 
    animation-delay: 6s; 
}
.cb-slideshow li:nth-child(3) div { 
    animation-delay: 12s; 
}
.cb-slideshow li:nth-child(4) div { 
    animation-delay: 18s; 
}
.cb-slideshow li:nth-child(5) div { 
    animation-delay: 24s; 
}


@keyframes imageAnimation { 
    0% { opacity: 0; animation-timing-function: ease-in; }
    8% { opacity: 1; animation-timing-function: ease-out; }
    17% { opacity: 1 }
    25% { opacity: 0 }
    100% { opacity: 0 }
}

@keyframes titleAnimation { 
    0% { opacity: 1 }
    8% { opacity: 1 }
    17% { opacity: 1 }
    19% { opacity: 1 }
    100% { opacity: 1 }
}

.no-cssanimations .cb-slideshow li span{
    opacity: 1;
}

@media screen and (max-width: 1140px) { 
    .cb-slideshow li div h3 { font-size: 140px }
}
@media screen and (max-width: 600px) { 
    .cb-slideshow li div h3 { font-size: 80px }
}
</style>


<div  style="overflow: hidden; position: relative; white-space: nowrap;">

    <ul class="cb-slideshow">
    <li><span>Image 01</span><div></div></li>
    <li><span>Image 02</span><div></div></li>
    <li><span>Image 03</span><div></div></li>
    <li><span>Image 04</span><div></div></li>
    <li><span>Image 05</span><div></div></li>
    </ul>  

</div>

Solution

  • After some debugging I found that the Perfect Scrollbar was activating.

    To fix this I override it for just this page:

    .ps-scrollbar-y-rail {
      display: none !important;
    }