0

**我見過一些有用的解決方案,爲其他人工作..在我的標籤中實現它們..注意到順序,但仍然我的旋轉木馬滑塊不會自動啓動?誰能幫忙?請參見下面的代碼:**旋轉木馬沒有自動啓動

<!DOCTYPE html> 
<html> 
<head> 
<link href="css/bootstrap.css" rel="stylesheet"> 
    <style type="text/css"> 
     body { 
     padding-top: 60px; 
     padding-bottom: 40px; 
     } 
    </style> 

    <link href="css/bootstrap-responsive.css" rel="stylesheet"> 
    <script>window.jQuery || document.write('<script src="js/jquery-1.7.2.min.js"><\/script>')</script> 

    <!-- Bootstrap jQuery plugins compiled and minified --> 
    <script src="js/jquery-1.7.2.min.js"></script> 
    <script src="js/bootstrap.min.js"></script> 

    <script type="text/javascript"> 
     $(document).ready(function() { 
     $('#this-carousel-id').carousel({    // For Carousel Image Slider 
      interval: 4000, 
      cycle: true, 
      }).trigger('slid'); 

    </script> 
</head> 

<body> 
<!-- Carousel - consult the Twitter Bootstrap docs at 
     http://twitter.github.com/bootstrap/javascript.html#carousel --> 

<div id="this-carousel-id" class="carousel slide"><!-- class of slide for animation --> 
    <div class="carousel-inner"> 
    <div class="item active"><!-- class of active since it's the first item --> 
     <img src="/images/3plogo.jpg" alt="" /> 
     <div class="carousel-caption"> 
     <p>Check out our Latest Events</p> 
     </div> 
    </div> 
    <div class="item"> 
     <img src="/images/cs.jpg" alt="" /> 
     <div class="carousel-caption"> 
     <p>We can help with getting you Corporate Sponsorships</p> 
     </div> 
    </div> 
    <div class="item"> 
     <img src="/images/edp.jpg" alt="" /> 
     <div class="carousel-caption"> 
     <p>We do Event Design & Planning </p> 
     </div> 
    </div> 
    <div class="item"> 
     <img src="/images/brandmanagement.jpg" alt="" /> 
     <div class="carousel-caption"> 
     <p>Brand Management you can count on!</p> 
     </div> 
    </div> 
    </div><!-- /.carousel-inner --> 
    <!-- Next and Previous controls below 
     href values must reference the id for this carousel --> 
    <a class="carousel-control left" href="#this-carousel-id" data-slide="prev">&lsaquo;</a> 
    <a class="carousel-control right" href="#this-carousel-id" data-slide="next">&rsaquo;</a> 
</div><!-- /.carousel --> 

<!-- end carousel --> 

回答

0

能否請您刪除您的觸發屬性,並嘗試

$(document).ready(function() { 
    $('.carousel').carousel({ 
    interval: 2000 
    }) 

應該工作正常..

0

twitter bootstrap 3,你應該調用carousel('cycle')方法初始化後的傳送帶:

<script type="text/javascript"> 
$(document).ready(function() { 
    $('.carousel').carousel({ 
     interval: 3000 
    }); 

    $('.carousel').carousel('cycle'); 
}); 
</script>