I need a carousel component, that can show several images in a row and that will allow the user to flip through them - advancing one at a time.
Does anyone know of such a component?
ps
I know that if I put several images in one li of orbit (and float them) I get something similar. but that solution doesn't work well of different sizes of screens.
I don't think that F4 supports that natively. Why not use something like this within a responsive Foundation div?
http://jcemer.com/zepto-carousel/
for example, modifying the example on github:
<div class="row">
<div class="small-12 large-4 columns">
<div class="container">
<ul>
<li>Page 1</li>
<li>Page 2</li>
<li>Page 3</li>
<li>Page 4</li>
</ul>
</div>
</div>
</div>
Related
I am trying to align this Back button in a grid. I can only get to align to the top or center. Could someone provide an example on how to do this?
thx
<!-- Action bar clone -->
<div id="header">
<div class="col-xs-12 navbar-inverse navbar-top">
<div class="row" role="nav" id="topNav">
<div class="col-xs-2">
<div class="glyphiconHeaderBack"><i class="glyphicon glyphicon-arrow-left"></i></div>
</div>
<div class="col-xs-8 text-center glyphiconHeader"><h1>Test Header</h1></div>
<div class="col-xs-2> </div>
</div>
</div>
</div>
Out of the box bootstrap doesn't have a great vertical align option. In the past what I have done (and from most of what I've seen out there) is using padding to align items where you want. Adding some onto your back element aligns it much better for me.
padding:24px;
View it in action here: http://codepen.io/egerrard/pen/xEYOzy
I have had a search and cannot find this exact problem so I hope the question is not duplicate.
First time users of Bootstrap 3.
From reading here and the bootstrap documentation I believe the navbar should have its own container such as:
<nav id="myNavbar" class="navbar navbar-default navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbarCollapse">
<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="/index.html">My Site</a>
</div>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="nav navbar-nav">
<li class="active"><span class="glyphicon glyphicon-home"></span> Home</li>
<li><span class="glyphicon glyphicon-list-alt"></span> Services</li>
<li><span class="glyphicon glyphicon-info-sign"></span> About</li>
<li><span class="glyphicon glyphicon-envelope"></span> Contact</li>
</ul>
</div>
</div>
</nav>
<div class="container">
<div class="row">content goes here and this content is under the navbar</div>
</div>
The body of the page then has its own container. Is that Correct?
I have done that and then added a row but the first row content is under the navbar.
Have I missed something like a class that I should add to the first row to ensure it starts below the navbar and not after it?
I found a similar question where the answer was to ensure the navbar had "navbar-fixed-top" but I already have that.
Read documentation carefully.
According to Bootstrap navbar docs:
The fixed navbar will overlay your other content, unless you add padding to the top of the body. Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.
body {
padding-top: 70px; // Your navbar height
}
Make sure to include this after the core Bootstrap CSS.
If I understand your problem correctly that you want content below the navbar just write
navbar-fixed
instead of
navbar-fixed-top
like this
<nav id="myNavbar" class="navbar navbar-default navbar-inverse navbar-
fixed"role="navigation">
it will work
see this fiddle fiddle
are you looking for this ???
This is caused by the Bootstrap class fixed-top, Fixed navbars use position: fixed, which pulls the Nav from the normal flow of the DOM.
For this to have an effect, having your content below the Navbar not overflow unto the Navbar, BootStrap Docs>> https://getbootstrap.com/docs/4.5/components/navbar/
Under the #Placement section, advise you to give custom CSS to the body.
Add some padding to the <body style="padding: somepadding"> element.
i have downloaded a bootstrap carousel template and everything works fine aside from the controls of the carousel. I can see the controls but nothing happens when i click on the left or right control. Any help would be much appreciated. Here are (what i think are) the relevant lines of code:
thanks for your help !
<!-- Carousel
================================================== -->
<div id="myCarousel" class="carousel slide">
<!-- 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>
<div class="carousel-inner">
<div class="item active">
<div class="carousel-caption">
<h1>Bootstrap 1 Carousel Layout</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
</div>
</div>
</div>
<div class="carousel-inner">
<div class="item">
<div class="carousel-caption">
<h1>Bootstrap 2 Carousel Layout</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
</div>
</div>
</div>
<div class="carousel-inner">
<div class="item">
<div class="carousel-caption">
<h1>Bootstrap 3 Carousel Layout</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
</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>
<!-- /.carousel -->
here are the script references:
<!-- script references -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/scripts.js"></script>
I think you misunderstood the documentation. There should be only ONE <div class="carousel-inner">. This is the wrapper for your "items". Change your html between the indicators and the controls like this and you should have more success:
<div class="carousel-inner">
<div class="item active">
<div class="carousel-caption">
<h1>Bootstrap 1 Carousel Layout</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
</div>
</div>
<div class="item">
<div class="carousel-caption">
<h1>Bootstrap 2 Carousel Layout</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
</div>
</div>
<div class="item">
<div class="carousel-caption">
<h1>Bootstrap 3 Carousel Layout</h1>
<p>Bootstrap 3 still features a 12-column grid, but many of the CSS class names have completely changed.</p>
</div>
</div>
</div>
Also, if you want the carousel to automatically begin cycling on load, you can add: data-ride="carousel"To the outermost div (the one with your id)
EDIT: One other thing I forgot to mention...
If you don't add some content to the item div, you won't see anything, not even your captions. That's because the captions are set to the bottom of the item div. If you just want to test things out without the content, just add the following css to cause the item div to have some height (I also added a background color so the white text will show up better against the white background):
div.item {
height: 500px;
background-color: green;
}
I am using bootstrap in my website to make it responsive (I will be making a custom design and not use bootstrap's default css). I have created a bootstrap3 navbar but the button which appears after shrinking the viewport does not function as nothing happens when it is clicked.
I have searched for this on stackoverflow and even tried incorporating changes mentioned here. But its not working.
Javascript is enabled in my browser and I have referenced bootstrap.js in my html as well.
My code is as follows:
<div class="navbar navbar-default navbackcolor" role="navigation">
<div class="container">
<div class="comnWdth">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<span class="number">X12 X123 X123</span>
<span class="text">10am-7pm Mon-Sat</span>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav pull-right">
<li class="active">Home</li>
<li>My Account</li>
<li>Logout</li>
<li>Register</li>
<li>Login</li>
<li>My Cart</li>
</ul>
</div>
</div> <!-- End .comnWdth -->
</div> <!-- End container -->
</div> <!-- End Navbar -->
Also the toggle button and header ("X12 X123 X123 10am-7pm Mon-Sat") is appearing in different rows when collapsed. How can I make them appear in the same row when in a narrow viewport?
Thanks.
As of Bootstrap 3, you should use navbar-right instead of pull-right inside a navabr:
<ul class="nav navbar-nav navbar-right">.
As for your second question, you should probably post it separately, and include your css because there are clearly custom classes there "text" and "number" that we'll need to know to make good suggestions.
How can I vertically center the glyphicon (and badge) elements in this context:
<ul class="list-group">
<li class="list-group-item">
Multi-line content...
<span class="glyphicon glyphicon-chevron-right pull-right"/>
</li>
<li class="list-group-item">
Multi-line content...
<span class="badge">123</span>
</li>
</ul>
By multi-line content I mean a varying number of lines and in some cases wrapping text and a variety of font sizes.
This is to provide navigation pages for a mobile app that include the visual hint of an arrow over to the right. When the content wraps or has other multi-line elements vertical centering is what other frameworks provide but they typically use background images. I am using Bootstrap 3.0.0.
How about this..
.list-group-item span {
margin-top: -0.5em;
}
DEMO: http://bootply.com/95790
<div class="list-group">
<div class="list-group-item">
<div class="media-body">
Multi-line content...
</div>
<div class="media-right" style="vertical-align:middle;">
<span class="glyphicon glyphicon-chevron-right"></span>
</div>
</div>
</div>