2015-06-19 30 views
1

我一直在試圖遵循教程並實現引導傳送帶滑塊。我想稍後在我自己的網頁上使用它,但要知道我只是想讓它工作。Asp.net引導傳送帶滑塊不起作用

現在它不顯示我在Visual Studio中創建的asp.net webform中的任何內容。我不確定什麼是錯的,因爲代碼是一樣的。

代碼:

<!DOCTYPE html> 

<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
    <title>Fullslider</title> 

    <link href="Content/full-slider.css" rel="stylesheet" /> 
    <link href="Content/bootstrap.min.css" rel="stylesheet" /> 


    <script src="Script/jquery.js"></script> 
    <script src="Script/bootstrap.min.js"></script> 


</head> 
<body> 
<form id="form1" runat="server"> 

    <!-- Navigation --> 
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation"> 
     <div class="container"> 
      <!-- Brand and toggle get grouped for better mobile display --> 
      <div class="navbar-header"> 
       <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"> 
        <span class="sr-only">Toggle navigation</span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
        <span class="icon-bar"></span> 
       </button> 
       <a class="navbar-brand" href="#">Start Bootstrap</a> 
      </div> 
      <!-- Collect the nav links, forms, and other content for toggling --> 
      <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1"> 
       <ul class="nav navbar-nav"> 
        <li> 
         <a href="#">About</a> 
        </li> 
        <li> 
         <a href="#">Services</a> 
        </li> 
        <li> 
         <a href="#">Contact</a> 
        </li> 
       </ul> 
      </div> 
      <!-- /.navbar-collapse --> 
     </div> 
     <!-- /.container --> 
    </nav> 

    <!-- Full Page Image Background Carousel Header --> 
    <header 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> 
     </ol> 

     <!-- Wrapper for Slides --> 
     <div class="carousel-inner"> 
      <div class="item active"> 
       <!-- Set the first background image using inline CSS below. --> 
       <div class="fill" style="background-image: url('http://placehold.it/1900x1080&text=Slide One');"></div> 
       <div class="carousel-caption"> 
       </div> 
      </div> 
      <div class="item"> 
       <!-- Set the second background image using inline CSS below. --> 
       <div class="fill" style="background-image: url('http://placehold.it/1900x1080&text=Slide Two');"></div> 
       <div class="carousel-caption"> 
       </div> 
      </div> 
      <div class="item"> 
       <!-- Set the third background image using inline CSS below. --> 
       <div class="fill" style="background-image: url('http://placehold.it/1900x1080&text=Slide Three');"></div> 
       <div class="carousel-caption"> 
        <h2>Caption 3</h2> 
       </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> 

    </header> 

      <!-- jQuery --> 
    <script src="js/jquery.js"></script> 

    <!-- Bootstrap Core JavaScript --> 
    <script src="js/bootstrap.min.js"></script> 

    <!-- Script to Activate the Carousel --> 
    <script> 
     $('.carousel').carousel({ 
      interval: 5000 //changes the speed 
     }) 
</script> 

</form> 


</body> 
</html> 

的代碼有標準的引導的導航欄,其完美的作品..但只是空的空間,傳送帶應該的。

任何可以看到什麼是錯的?

CSS文件:

/*! 
* Start Bootstrap - Full Slider HTML Template (http://startbootstrap.com) 
* Code licensed under the Apache License v2.0. 
* For details, see http://www.apache.org/licenses/LICENSE-2.0. 
*/ 

html, 
body { 
    height: 100%; 
} 

.carousel, 
.item, 
.active { 
    height: 100%; 
} 

.carousel-inner { 
    height: 100%; 
} 

/* Background images are set within the HTML using inline CSS, not here */ 

.fill { 
    width: 100%; 
    height: 100%; 
    background-position: center; 
    -webkit-background-size: cover; 
    -moz-background-size: cover; 
    background-size: cover; 
    -o-background-size: cover; 
} 

footer { 
    margin: 50px 0; 
} 
+0

爲什麼你包含'jquery.js'和'bootstrap.min.js'兩次? –

+0

我很新..所以這只是我試圖讓它工作 – Mikkel

+0

你想要整頁滑動?我的意思是顯示爲身體背景的幻燈片? –

回答

2

好吧,我只是看到了一些不同的代碼,可能是因爲它的它也不會管用!

以下是這可能是爲什麼它不工作的原因可能的原因:

  • 您使用基本上你使用的不是div
  • <header><div>代替<img>,你用來設置該<div>background-imagecaption你有一個更div
  • 你有一些額外的類添加到您的<div>有它自己的風格這將影響其原有的風格
  • 總的來說它是在後臺工作,但它的高度是越來越影響

看到這個DEMO與旋轉木馬的基本和初始設計

<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 active"> 
       <img src="https://placehold.it/1900x1080&text=Slide One" alt="Chania"/> 
      </div> 

      <div class="item"> 
       <img src="https://placehold.it/1900x1080&text=Slide Two" alt="Chania"/> 
      </div> 

      <div class="item"> 
       <img src="https://placehold.it/1900x1080&text=Slide Three" alt="Flower"/> 
      </div> 

      <div class="item"> 
       <img src="https://placehold.it/1900x1080&text=Slide Two" 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> 
+1

謝謝,對我來說問題是改變成div像:。@Guruprasad Rao – zahed

+0

@zahed ..很高興幫助..快樂編碼.. :) –