William Fernandez William Fernandez - 4 months ago 14
jQuery Question

Bootstrap 3 Carousel Issue, blank screen

Tried implementing bootstrap carousel into my website. The result I get is below. Thoughts? I don't think it is a CSS problem but I am not too sure. I have looked around and cant find a conclusive answer as to why my implementation is not coming out correctly.

<!DOCTYPE html>
<html>
<head>
<meta charset = "UTF-8">
<title>Welcome</title>
<link href ="WorkingFolder/css/bootstrap_custom/bootstrap.css" rel ="stylesheet">
</head>
<body>
<nav class="navbar navbar-inverse navbar-fixed-right">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href ="#">|X|</a>
</div>

<!--Navigation control-->
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="active"><a href ="#">Home</a></li>
<li><a href="Portfolio.html">Portfolio</a></li>
<li><a href ="Services.html">Services</a></li>
</li>
</ul>
</div>
</div>
</nav>
<div class ="container">
<div id="mycarousel" class="carousel slide" data-ride="carousel">
<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>

<div class="carousel-inner">
<div class="item active">
<div class="slide1"></div>
<div class="carousel-caption">
<h1>William Xavier Fernandez</h1>
<p>|X|</p>
<p><a href="#" class="btn btn-primary btn-sm">More Detail</a></p>
</div>
</div>
<div class="item">
<div class="slide2"></div>
<div class="carousel-caption">
<h1>Web Design|Bootstrap|JQuery|</h1>
<p>|X|</p>
</div>
</div>
<div class="item">
<div class="slide3"></div>
<div class="carousel-caption">
<h1>View my portfolio of work above</h1>
<p>|X|</p>
</div>
</div>
</div>

<!--Navigation control-->
<a class="left carousel-control" href="#mycarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span>
</a>
<a class="right carousel-control" href="#mycarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span>
</a>
</div>
</div>
<div class="container">
<p>blah blah blah blah blah blah</p>
<p>blah blah blah blah blah blah</p>
<p>blah blah blah blah blah blah</p>
</div>
<script src = "WorkingFolder/jquery-3.0.0.min.js"></script>
<script src="WorkingFolder/js/bootstrap.min.js"></script>

</body>




The result I get

`

Answer

Looking at the bootstrap documentation it looks like they've got an img setting the slide background and you're using a div classed with the slide number...I don't know if thats the sole cause here but I made a fiddle where instead of using

<div class="slide2"></div>

I put in;

<img src="image.jpg"/>

and that's got it working so far as i can tell.

https://jsfiddle.net/at4x4w8v/2/

Comments