Bootstrap - Carousel | Links not working -


i have been using video tutorial bootstrap carousel , somehow code same per video yet links not working...

the code...

    <!doctype html>     <html>     <head>     <meta charset="utf-8">     <title>portfolio document</title>     <link rel="stylesheet" type="text/css" href="css/bootstrap.css">     <script src="js/bootstrap.min.js"></script>     <script src="https://code.jquery.com/ui/1.11.4/jquery-ui.min.js">           </script>      </head>     <body>  <nav class="navbar navbar-default">      <div class="container">          <div class="navbar-header">              <div class="navbar-brand">photo gallery</div>          </div>          <ul class="nav navbar-nav">              <li><a href='#'>home</a></li>             <li><a href='#'>nature gallery</a></li>             <li><a href='#'>science gallery</a></li>          </ul>       </div>  </nav>  <div class="container">      <div class="row">          <div class="col-md-10 col-md-offset-1">              <div class="carousel slide" data-ride="carousel" id="slider">                  <ol class="carousel-indicators">                     <li data-target="#slider" data-slide-to="0" class="active"></li>                     <li data-target="#slider" data-slide-to="1"></li>                     <li data-target="#slider" data-slide-to="2"></li>                     <li data-target="#slider" data-slide-to="3"></li>                 </ol>                  <div class="carousel-inner">                      <div class="item active"><img src="img/slide01.png"></div>                     <div class="item"><img src="img/slide02.png"></div>                     <div class="item"><img src="img/slide01.png"></div>                     <div class="item"><img src="img/slide02.png"></div>                  </div>                  <a href="#slider" data-slide="prev" class="left carousel-control">                     <span class="glyphicon glyphicon-chevron-left"></span>                 </a>                  <a href="#slider" data-slide="next" class="right carousel-control">                     <span class="glyphicon glyphicon-chevron-right"></span>                 </a>              </div>           </div>      </div>   </div>   </body> </html> 

another issue is, using images of 750px*300px , in desktop view there grey shade area on right of image. while in mobile or responsive view grey shade area isnt visible. can please suggest how rectify issue?

please people, new web-designing , new stackoverflow :)

your links wont work because need load jquery.js before bootstrap.js flip these around in head section. need load jquery , not jquery ui should following

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

then images need have css them fill carousel

#slider .item {   height: 250px; } #slider .item img{   width: 100%;   height: 100%; } 

here fiddle see working fiddle

the thing images can become skewed in responsive design , images have different sizes may want create background image each of carousel items.

#slider .item {   padding-bottom: 50%; } #slider .first-item{   background: url('http://placehold.it/350x150');   background-size: cover;   background-position: center; } #slider .second-item{   background: url('http://placehold.it/350x150');   background-size: cover;   background-position: center; } #slider .third-item{   background: url('http://placehold.it/350x150');   background-size: cover;   background-position: center; } #slider .fourth-item{   background: url('http://placehold.it/350x150');   background-size: cover;   background-position: center; } 

and html carousel inner this:

            <div class="carousel-inner">                  <div class="item active first-item"></div>                 <div class="item second-item"></div>                 <div class="item third-item"></div>                 <div class="item fourth-item"></div>              </div> 

here fiddle of working fiddle


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -