2017-05-31 87 views
0

我已經添加了一個旋轉木馬幻燈片到我的頁面。它在Internet Explorer中工作正常,但不是在Chrome和Mozilla。我的意思是旋轉木馬幾秒鐘後自動滑動。它給滑動效果在其他人身上,但不是在鉻和mozilla,雖然圖像正在改變。我怎麼也給鉻的滑動效果。旋轉木馬幻燈片不滑動在鉻和mozilla

下面是代碼:

<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script> 
    <link rel="stylesheet" type="text/css" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css"> 
    <link rel="stylesheet" href="//netdna.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css"> 
    <div id="myCarousel" class="carousel slide" data-ride="carousel" data-interval="3000" style="margin-top:-22px; margin-left:-15px; margin-right:-15px;"> 
     <!-- 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> 
      <li data-target="#myCarousel" data-slide-to="4"></li> 
      <li data-target="#myCarousel" data-slide-to="5"></li> 
     </ol> 
     <!-- Wrapper for slides --> 
     <div class="carousel-inner"> 
      <div class="item active"> 
       <img src="http://lorempixel.com/900/400/" alt="slid0" class="img-responsive"> 
       <div class="carousel-caption"></div> 
      </div> 
      <div class="item"> 
       <img src="http://lorempixel.com/900/400/" alt="slid1" class="img-responsive"> 
       <div class="carousel-caption"></div> 
      </div> 
      <div class="item"> 
       <img src="http://lorempixel.com/900/400/" alt="slid2" class="img-responsive"> 
       <div class="carousel-caption"></div> 
      </div> 
      <div class="item"> 
       <img src="http://lorempixel.com/900/400/" alt="slid3" class="img-responsive"> 
       <div class="carousel-caption"></div> 
      </div> 
      <div class="item"> 
       <img src="http://lorempixel.com/900/400/" alt="slid4" class="img-responsive"> 
       <div class="carousel-caption"></div> 
      </div> 
      <div class="item"> 
       <img src="http://lorempixel.com/900/400/" alt="slid5" class="img-responsive"> 
       <div class="carousel-caption"></div> 
      </div> 
     </div> 
     <!-- Controls --> <a class="left carousel-control" href="#myCarousel" data-slide="prev"> 
      <span class="icon-prev"></span> 
     </a> 
     <a class="right carousel-control" href="#myCarousel" data-slide="next"> 
      <span class="icon-next"></span> 
     </a> 

    </div> 
+0

你能提一下你正在使用的腳本嗎 – TheDarkKnight

回答

0

嘗試清除谷歌瀏覽器的緩存。我遇到類似的問題,並在清除緩存後解決問題。

+0

沒有改變 – ani

0

你需要jQuery來使它工作。你可以添加行

<script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> 

到你的代碼(在javascript的bootstrap上面)來快速添加jQuery。

相關問題