为何在浏览html文件后显示空白结果?

时间:2018-05-13 17:44:27

标签: html

我试图在html文件中设置owl carousel并且我在头部分中包含了一些文件,当浏览html文件实例得到空白结果时,任何人都可以告诉我什么文件包括序列问题或遗漏的东西,我确实多次检查所有代码,但我没有得到我错过的,请任何人可以指导我这个?

included file in head section:

<head>
    <title>my practice</title>
        <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">

   <link rel="stylesheet" href="css/bootstrap.min.css" type="text/css">
   <link href="owlslider/owl.carousel.css" rel="stylesheet">
    <link href="owlslider/owl.theme.default.css" rel="stylesheet">
    <link rel="stylesheet" href="css/animate.css" type="text/css">

    <script src="owlslider/jquery.js"></script>
    <script src="owlslider/owl.carousel.js"></script>
    <script src="js/bootstrap.min.js"></script>
    </head>

和html正文代码如下:

<body>

<div id="owl-demo" class="owl-carousel owl-theme">

  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>
  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>
  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>
  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>
  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>
  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>
  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>
  <div class="item">
    <img style="width:100%; height:300px;" src="img/dnatesting.jpg" class="img-responsive"></div>

</div>

</body>

1 个答案:

答案 0 :(得分:0)

因为你没有初始化猫头鹰只是将这一行添加到你的js

$('.owl-carousel').owlCarousel();