2015-07-19 178 views
0

hui guys, 我有我的jumbotron和完整的背景圖像放置在它。我在想自己是否有可能讓它不僅僅是一張靜態圖像,而是讓一些幻燈片包含例如5張可以每5毫秒滑動一次的圖片?可能嗎?它怎麼能實現我提到的?我下面當前實現:Jumbotron圖像滑塊

HTML:

<div class="jumbotron"> 
      <div class="container"> 
      </div> 
      </div> 

和CSS它:

.jumbotron { 
    position: relative; 
    background: #000 url('35.jpg') center center no-repeat; 
    width: 100%; 
    background-size: cover; 
    overflow: hidden; 
    height: 370px; 
} 

問題與第二galery滑塊實現最上面的一個後:

<!-- Gallery --> 
    <div class="container"> 
     <section> 
      <div class="page-header" id="gallery"> 
       <h2>Kilka wykonanych projektów.<small> Couple of already realased projects.</small></h2> 
      </div> 

      <div class="carousel slide" id="screenshot-carousel" data-ride="carousel"> 
       <ol class="carousel-indicators"> 
        <li data-target="#screenshot-carousel" data-slide-to="0" class="active"></li> 
        <li data-target="#screenshot-carousel" data-slide-to="1"></li> 
        <li data-target="#screenshot-carousel" data-slide-to="2"></li> 
        <li data-target="#screenshot-carousel" data-slide-to="3"></li> 
       </ol> 
       <div class="carousel-inner"> 
        <div class="item active"> 
         <img src="highway.jpg" alt="Text of the image"> 
         <div class="carousel-caption"> 
          <h3>Highway heading</h3> 
          <p>This is the caption</p> 
         </div> 
        </div> 
        <div class="item"> 
         <img src="river.jpg" alt="Text of the image"> 
         <div class="carousel-caption"> 
          <h3>River heading</h3> 
          <p>This is the caption</p> 
         </div> 
        </div> 
        <div class="item"> 
         <img src="street.jpg" alt="Text of the image"> 
         <div class="carousel-caption"> 
          <h3>Street heading</h3> 
          <p>This is the caption</p> 
         </div> 
        </div> 
        <div class="item"> 
         <img src="painting.jpg" alt="Text of the image"> 
         <div class="carousel-caption"> 
          <h3>Painting heading</h3> 
          <p>This is the caption</p> 
         </div> 
        </div> 

       </div><!-- End Carousel inner --> 
       <a href="#screenshot-carousel" class="left carousel-control" data-slide="prev"> 
        <span class="glyphicon glyphicon-chevron-left"></span> 
       </a> 
       <a href="#screenshot-carousel" class="right carousel-control" data-slide="next"> 
        <span class="glyphicon glyphicon-chevron-right"></span> 
       </a> 
      </div><!-- End Carousel --> 

     </section> 
    </div> 

這是圖像變化後的外觀如何:

enter image description here

回答

2

看到這個bootply代碼如何定製一個轉盤內的超大屏幕演示:http://www.bootply.com/61935

的基本要點是把div的內部超大屏幕的旋轉木馬的容器,以便ü具有旋轉木馬循環的特性。

+0

確定其工作,但是當我想要在網頁上再次使用它時,它不會像靜態一樣工作。我可以點擊箭頭,但圖像不會改變整個滑塊並不是全部寬度,最新錯誤? – Arie

2

如需帶jumbotron傳送帶的參考,您可以檢查my practice page!。如果你檢查它,它有可讀的代碼。

整個滑塊不是全部寬度你已經把它放在一個容器div內。只需關閉容器div並在大桶內重新打開(這是可選的,您也可以在沒有容器的情況下使用它,或者使用容器流體代替容器來覆蓋整個寬度)