Owl Carousel 2 sets itself to display none

Sam R picture Sam R · Apr 12, 2016 · Viewed 11.5k times · Source

im trying to get owl carousel 2 to work on my php site. I have used the exact same code on an Anguler site, besides the function of course. So This should work. Here is my script and links

jQuery(document).ready(function(){
  jQuery('#owl2').owlCarousel({
    navigation: true,
    nav: true,    
    dots: false,
    margin: 50,
    dotsEach: false,
    dotData: false,
    center: true,
    autoWidth: true,
    items: 5,
    center:true,
    slideSpeed: 300,
    paginationSpeed: 400,                        
    autoPlay: false,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:3
        },
        1000:{
            items:5
        }
        }
    });
});

the html

 <div class="container">
    <div class="row">
        <div class="col-md-12">            
                <div id="owl2" class="owl-carousel owl-theme">
                    <div class="item verticle-align">
                        <img class="verticle-align" src="img/metabo.png" alt="">
                    </div>
                    <div class="item">
                        <img class="verticle-align" src="img/aeroquip.png" alt="">
                    </div>
                    <div class="item">
                        <img class="verticle-align" src="img/IR.png" alt="">
                    </div>
                    <div class="item">
                        <img class="verticle-align" src="img/huck.png" alt="">
                    </div>
                    <div class="item">
                        <img class="verticle-align" src="img/infasco.png" alt="">
                    </div>   
                    <div class="item">
                        <img class="verticle-align" src="img/metabo.png" alt="">
                    </div>   
                    <div class="item">
                        <img class="verticle-align" src="img/chicago-pneumatic.jpg" alt="">
                    </div> 
                    <div class="item">
                        <img class="verticle-align" src="img/Gesipa.jpg" alt="">
                    </div>               
                </div>            
        </div>
    </div>
</div> 

and my links

 <!-- Bootstrap -->
    <link rel="stylesheet" type="text/css" href="css/boot/bootstrap.css">
    <link rel="stylesheet" type="text/css" href="css/boot/bootstrap-theme.css">


    <!--owl css-->
    <link rel="stylesheet" type="text/css" href="css/owl_carousel/owl.carousel.css">
    <link rel="stylesheet" type="text/css" href="css/owl_carousel/owl.theme.css">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.transitions.min.css" >

    <!--Other CSS files-->
    <link rel="stylesheet" type="text/css" href="css/responsive.css">
    <link rel="stylesheet" type="text/css" href="css/main.css">
    <link rel="stylesheet" type="text/css" href="css/fa/font-awesome.css">

    <!--Jquery-->
    <script src="js/jquery-2.2.3.min.js"></script>


    <!-- Bootstrap JS -->
    <script src="js/boot/bootstrap.js"></script>
    <!--<script src="js/boot/bootstrap.min.js"></script>-->

    <!--Other Js files-->    
    <script src="js/main.js"></script>
    <script src="js/owl/owl.carousel.js"></script>

I have done this many times before but cant seem to get it to work this time. Anyone have any idea what I am doing wrong?

I was asked to add the second carousel i am using on the page, below is the html/js for said carousel

<div id="owl" class="owl-carousel owl-theme">
                <div class="item first-item">
                    <div class="products-images">
                        <a href="./img/catalog/9-Assortments-Storage.pdf"     target="_blank">Assortments</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/4-Tools.pdf"               target="_blank">Tools</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/4-Tools.pdf" target="_blank">Cutting Tools</a>
                    </div>
                </div>
                <div class="item active">
                    <div class="products-images ">
                        <a href="./img/catalog/7-Brass.pdf" target="_blank">Fittings</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/6-Electrical.pdf" target="_blank">Electrical</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/1-Fasteners.pdf" target="_blank">Fasteners</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/2014Safety.pdf" target="_blank">Saftey</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/5-ShopSupplies.pdf" target="_blank">Shop Supplies</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/2-Rivets-Huck.pdf" target="_blank">Rivets</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/2014CustomPackaging.pdf" target="_blank">Custom Packaging</a>
                    </div>
                </div>
                <div class="item">
                    <div class="products-images">
                        <a href="./img/catalog/3-Chemicals.pdf" target="_blank">Chemicals</a>
                    </div>
                </div>
            </div>
<script type="text/javascript">
jQuery(document).ready(function(){
  jQuery('#owl').owlCarousel({
    navigation: true,
    nav: true,    
    dots: false,
    dotsEach: false,
    dotData: false,
    center: true,
    autoWidth: true,
    items: 7,
    center:true,
    slideSpeed: 300,
    paginationSpeed: 400,                        
    autoPlay: false,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:3
        },
        1000:{
            items:5
        }
        }
    });
});
</script>

Answer

Sam R picture Sam R · Apr 13, 2016

SOLVED

So the issue seemed to be my owl.carousel.min.js file AND my css files, I downloaded the newest version when I started. However when using this link

    <script src="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.3/owl.carousel.min.js"></script>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.3/assets/owl.carousel.min.css">
    <link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/OwlCarousel2/2.0.0-beta.3/assets/owl.theme.default.min.css">

It started working. not sure if the file I downloaded was corrupted somehow but no matter. Its working now. Hope this helps someone out in the future!!

Special thanks to @Marcus who talked with me for a while yesterday trying to help me fix this issue. Thanks a bunch bud!