我的Bootstrap Carousel没有显示&显示一些JS错误

时间:2016-12-26 17:15:36

标签: javascript jquery html twitter-bootstrap css3



<div class="padding-container mdbgcont container-out">

    <div class="container-out background-color-blue full-height-container">

    <div class="title title-section">
    <h2 class="text-white sm-padding-top"><i class="fa fa-pencil"></i> &nbsp;LIVERIGHT BLOG</h2>
</div><!-- .title.title-section -->



<div class="carousel-wrap animation animation-from-left" style="height:210px;">
    <ul class="carousel-nav">
    <li><a href="#" class="btn btn-icon-prev prev"></a></li>
    <li><a href="#" class="btn btn-icon-next next"></a></li>
    </ul><!-- .carousel-nav -->
    <div class="carousel" data-visible="3">

    <article class="post post-latest post-type-video">

    <div class="post-heading">
    <div class="thumbnail">

    <div class="slider">
    <img src="img/uploads/posts/3/thumbnail_L.jpg" alt="Image" title="Image" />
    </div><!-- .slider -->

    </div><!-- .thumbnail -->

    </div><!-- .post-heading -->


    <div class="post-content">


    <div class="title ">
    <h2 class="h5"><a href="#" class="">Daily Health Tips</a></h2>

</div><!-- .title -->

</div><!-- .post-content -->


</article><!-- .post -->


<article class="post post-latest post-type-text">

    <div class="post-heading">
    <div class="thumbnail">
    <a class="link" href="blog-single.php">
    <span class="btn btn-icon-link"></span>
    <img src="img/uploads/posts/4/thumbnail_L.jpg" alt="Image" title="Image" />
    </a>
    </div><!-- .thumbnail -->

    </div><!-- .post-heading -->


    <div class="post-content">



    <div class="title">
    <h2 class="h5"><a href="#" class="">Best daily exercises</a></h2>

</div><!-- .title -->


</div><!-- .post-content -->


</article><!-- .post -->


<article class="post post-latest post-type-music">

    <div class="post-heading">
    <div class="thumbnail">

    <div class="slider">
    <img src="img/uploads/posts/5/thumbnail_L.jpg" alt="Image" title="Image" />
    </div><!-- .slider -->

    </div><!-- .thumbnail -->

    </div><!-- .post-heading -->


    <div class="post-content">



    <div class="title">
    <h2 class="h5"><a href="#" class="">Importance of routine checkups</a></h2>

</div><!-- .title -->

</div><!-- .post-content -->


</article><!-- .post -->


<article class="post post-latest post-type-gallery">

    <div class="post-heading">
    <div class="thumbnail">
    <a class="link" href="blog-single.php">
    <span class="btn btn-icon-link"></span>
    <img src="img/uploads/posts/6/thumbnail_L.jpg" alt="Image" title="Image" />
    </a>
    </div><!-- .thumbnail -->

    </div><!-- .post-heading -->


    <div class="post-content">



    <div class="title">
    <h2 class="h5"><a href="blog-single.php">Ex ea commodo</a></h2>

</div><!-- .title -->



</div><!-- .post-content -->


</article><!-- .post -->



</div><!-- .carousel -->
</div><!-- .carousel-wrap -->
<div class=" text-center">
    <h4 class="btn h2 ">View All Blog Post</h4>
</div>

</div><!-- .container-out -->

</div> <!--container-->
&#13;
&#13;
&#13;

我的旋转木马没有显示和显示错误。 。 我试图包含不同的js库,但其行为仍然相同。这里的代码在片段上工作正常,但不在我的页面,更新的bootstrap和js以及中 this Is the display that is showing

these are the errors

&#13;
&#13;
<!-- jQuery & Helper library -->
        <script type="text/javascript" src="js/library/jquery/jquery-1.10.2.min.js"></script>
<!-- SLIDER REVOLUTION 4.x SCRIPTS  -->
        <script type="text/javascript" src="js/library/slider-revolution/js/jquery.themepunch.plugins.min.js"></script>
        <script type="text/javascript" src="js/library/slider-revolution/js/jquery.themepunch.revolution.min.js"></script>

        
        <script type="text/javascript">
            $('#main-menu li.current').parents('li').addClass('current');
        </script>
        <script type="text/javascript" src="js/library/helper/jquery.easing.min.js"></script>
        <script type="text/javascript" src="js/library/helper/jquery.touchSwipe.min.js"></script>
        <script type="text/javascript" src="js/library/helper/jquery.mousewheel.min.js"></script>
        <script type="text/javascript" src="js/library/helper/imagesloaded.pkgd.min.js"></script>

        <!-- Options -->
        <script type="text/javascript" src="js/jquery.cookie.js"></script>
        <script type="text/javascript" src="js/theme-options.js"></script>

        <!-- Retina js -->
        <script type="text/javascript" src="js/library/retina/retina.js"></script>

        <!-- FancyBox -->
        <script type="text/javascript" src="js/library/fancybox/jquery.fancybox.pack8cbb.js?v=2.1.5"></script>

        <!-- Bootstrap js -->
       
        <script type="text/javascript" src="js/library/bootstrap/bootstrap.min.js"></script>
        <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
        
        
        

        <!-- Validate -->
        <script type="text/javascript" src="js/library/validate/jquery.validate.min.js"></script>

        <!-- FlickrFeed  -->
        <script type="text/javascript" src="js/library/jFlickrFeed/jflickrfeed.min.js"></script>
        <!-- carouFredSel -->
        <script type="text/javascript" src="js/library/carouFredSel/jquery.carouFredSel-6.2.1-packed.js"></script>

        <script type="text/javascript" src="js/library/jquery/jquery-1.10.2.min.js"></script>

       <!-- SLIDER REVOLUTION 4.x SCRIPTS  -->
        <script type="text/javascript" src="js/library/slider-revolution/js/jquery.themepunch.plugins.min.js"></script>
        <script type="text/javascript" src="js/library/slider-revolution/js/jquery.themepunch.revolution.min.js"></script>

        <!--scripts for current page -->
        <script type="text/javascript" src="js/page/home.js"></script>

        <script type="text/javascript" src="js/library/gmap/jquery.gmap.min.js"></script>
	<!--scripts for current page -->
	<script type="text/javascript" src="js/page/contact.js"></script>
        
        <!-- Main theme javaScript file -->
        <script type="text/javascript" src="js/theme.js"></script>
&#13;
<!-- begin snippet: js hide: false console: true babel: false -->
&#13;
&#13;
&#13;

[errrors] [3]

1 个答案:

答案 0 :(得分:0)

您的错误来自与Bootstrap无关的库。 Bootstrap轮播所需的3件事就是Bootstrap,jQuery和Bootstrap JS文件。

正确的HTML和正确的类。好的,这是四件事。

退房 http://getbootstrap.com/javascript/ 要么 http://www.w3schools.com/bootstrap/bootstrap_carousel.asp

我从w3schools复制了文本并将其放入codepen中。

http://codepen.io/anon/pen/ENqVGEhttp://codepen.io/anon/pen/ENqVGE

&#13;
&#13;
img {
  width:50%;
  margin-left:25%;
}
&#13;
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">


<div id="myCarousel" class="carousel slide" data-ride="carousel">
  <!-- Indicators -->
  <ol class="carousel-indicators">
    <li data-target="#myCarousel" data-slide-to="0" class="active"></li>
    <li data-target="#myCarousel" data-slide-to="1"></li>
    <li data-target="#myCarousel" data-slide-to="2"></li>
    <li data-target="#myCarousel" data-slide-to="3"></li>
  </ol>

  <!-- Wrapper for slides -->
  <div class="carousel-inner" role="listbox">
    <div class="item  text-center active">
      <img src="https://s3.amazonaws.com/static.oculus.com/website/2013/08/john_530_big.jpg" alt="Chania">
    </div>

    <div class="item">
      <img class="text-center img-responsive"  src="https://s3.amazonaws.com/static.oculus.com/website/2013/08/john_530_big.jpg" alt="Chania">
    </div>

    <div class="item">
      <img src="https://s3.amazonaws.com/static.oculus.com/website/2013/08/john_530_big.jpg" alt="Flower">
    </div>

    <div class="item">
      <img src="https://s3.amazonaws.com/static.oculus.com/website/2013/08/john_530_big.jpg" alt="Flower">
    </div>
  </div>

  <!-- Left and right controls -->
  <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
    <span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
    <span class="sr-only">Previous</span>
  </a>
  <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
    <span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
  </a>
</div>






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

<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
&#13;
&#13;
&#13;