猫头鹰旋转木马没有出现

时间:2015-05-20 18:19:04

标签: jquery html css twitter-bootstrap carousel

我正试图让这个猫头鹰的事情继续下去,它真的把我推回了一个项目。

<html>    
<head>
<link rel="stylesheet" href="css/bootstrap.css">
<link rel="stylesheet" href="css/bootstrap.min.css">
<link rel="stylesheet" href="css/owl.carousel.min.css">
<link rel="stylesheet" href="css/owl.theme.default.min.css">
</head>

<body>
<script src="js/jquery-1.11.3.js"></script>
<script src="js/owl.carousel.min.js"></script>
<script>
$('.owl-carousel').owlCarousel({
    loop:true,
    margin:10,
    nav:true,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:3
        },
        1000:{
            items:5
        }
    }
})
</script>
<div class="owl-carousel">
    <div class="item"><img src = "img/bg1.jpg"></div>
    <div class="item"><img src = "img/bg2.jpg"></div>
    <div class="item"><img src = "img/bg3.jpg"></div>
    <div class="item"><img src = "img/bg4.jpg"></div>
    <div class="item"><img src = "img/bg5.jpg"></div>
    <div class="item"><img src = "img/bg6.jpg"></div>
    <div class="item"><img src = "img/bg7.jpg"></div>
    <div class="item"><img src = "img/bg8.jpg"></div>
    <div class="item"><img src = "img/bg9.jpg"></div>
    <div class="item"><img src = "img/bg10.jpg"></div>
    <div class="item"><img src = "img/bg11.jpg"></div>
    <div class="item"><img src = "img/bg12.jpg"></div>
</div>    
</body>    
</html>

我做错了什么?

1 个答案:

答案 0 :(得分:1)

这是工作代码,您在配置中错过了自动播放道具

$(document).ready(function(){
  
$('.owl-carousel').owlCarousel({
    loop:true,
    margin:10,
    nav:true,
    autoPlay: 1000,
    responsive:{
        0:{
            items:1
        },
        600:{
            items:3
        },
        1000:{
            items:5
        }
    }
})
});
<link href="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.css" rel="stylesheet"/>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js"></script>

<script src="https://cdnjs.cloudflare.com/ajax/libs/owl-carousel/1.3.3/owl.carousel.min.js"></script>

<div class="owl-carousel">
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
    <div class="item"><img src = "http://placehold.it/350x150"></div>
</div>