I've recently implemented the infinite slide plugin, which you can find here: https://www.jqueryscript.net/slider/Infinite-Scroller-Plugin-jQuery.html. It's working flawlessly with images using the img tag
, but I'm encountering some issues when trying to use it with a background image.
Below you'll find the code snippets both with and without a background image. I specifically need help getting it to work properly with a background image. Can anyone assist me with this?
$(function(){$('.scroll1').infiniteslide();});
html,body{
margin: 0;
padding: 0;
height: 100%;
-webkit-font-smoothing: antialiased;
}
.scroll1 {
display: none;
}
.scroll1 img {
vertical-align: bottom;
width: 400px;
}
.banner_bg{
background-repeat: no-repeat;
background-size: cover;
width: 100%;
height: auto;
background-position: center;
min-height:100%;
}
.application_slider_1{
background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.4)),url('http://www.uniwallpaper.com/static/images/butterfly-wallpaper.jpeg');
}
.application_slider_2{
background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.8)),url('http://www.uniwallpaper.com/static/images/Wallpaper-20.jpg');
}
.application_slider_3{
background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.6)),url('http://www.uniwallpaper.com/static/images/Wallpaper-10.jpg');
}
.application_slider_4{
background-image: linear-gradient(rgba(0, 0, 0, 0.4), rgba(0, 0, 0, 0.7)),url('http://www.uniwallpaper.com/static/images/wallpaper-pictures_KMw1jzE.jpg');
}
<!--with background image-->
<ul class="scroll1">
<li><div class="application_slider_1 banner_bg"></div></li>
<li><div class="application_slider_2 banner_bg"></div></li>
<li><div class="application_slider_3 banner_bg"></div></li>
<li><div class="application_slider_4 banner_bg"></div></li>
</ul>
<!-- with img tag-->
<ul class="scroll1">
<li><img src="http://www.uniwallpaper.com/static/images/butterfly-wallpaper.jpeg" alt="" /></li>
<li><img src="http://www.uniwallpaper.com/static/images/Wallpaper-20.jpg" alt="" /></li>
<li><img src="http://www.uniwallpaper.com/static/images/Wallpaper-10.jpg"></li>
<li><img src="http://www.uniwallpaper.com/static/images/wallpaper-pictures_KMw1jzE.jpg"></li>
</ul>
<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://www.jqueryscript.net/demo/Infinite-Scroller-Plugin-jQuery/infiniteslidev2.js"></script>