Bootstrap 3 Carousel issues with flipping - google-chrome

let me explain you my problem.
I am building a website (here is the link http://www.greekorama.gr) and i'm having an issue with the carousel carousel and the navbar navbar-top-fixed.
If you try to scroll down using the side scroll-bar everything is fine.
But if you try to scroll down using the scroll-button on your mouse, then you will see that the top navbar is flipping.
Try to scroll and you will see what i am talking about.
It is happening on 4 pages. It's in greek language, here are the meanings
1)Αρχική Σελίδα = Home page
2)Παραγωγοί/Προϊόντα= Products/Producers
3)Καταλύματα= Accomodations
4)Επιχειρήσεις=Business
This is happening only on Google Chrome and Opera browsers (on IE,Safari and Firefox everything is ok).
I assume, that is something with the webkit going on. But i can not find out what.
The flipping is happening only bellow the carousel. I mean when you scroll down and carousel is dissapearing behind the navbar, at that moment the navbar is starting flipping.
Bellow is the top-fixed navbar code
<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>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a id="a-brand" class="navbar-brand center-block" href="index.php?content=home" style="font-size: 1.3em; font-family:Garamond, Verdana, Helvetica, Geneva, sans-serif;">Δήμος Θεσσαλονίκης</a>
</div>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="nav navbar-nav center-block" id="ul-navmenu">
<li><a id="a-navbar" href="index.php?content=home"><span class="glyphicon glyphicon-home"></span> Αρχική Σελίδα</a></li>
<li><a id="a-navbar" href="index.php?content=product_search"><span class="glyphicon glyphicon-leaf"></span> Παραγωγοί/Προϊόντα</a></li>
<li><a id="a-navbar" href="index.php?content=accom_search"><span class="glyphicon glyphicon-tower"></span> Καταλύματα</a></li>
<li><a id="a-navbar" href="index.php?content=business_search"><span class="glyphicon glyphicon-briefcase"></span> Επιχειρήσεις</a></li>
<li><a id="a-navbar" href="index.php?content=links"><span class="glyphicon glyphicon-link"></span> Σύνδεσμοι</a></li>
<li><a id="a-navbar" href="index.php?content=contact_form"><span class="glyphicon glyphicon-envelope"></span> Επικοινωνία</a></li>
<form class="navbar-form navbar-right" role="search" id="search">
<div class="form-group">
<input type="text" style="font-family:Garamond, Verdana, Helvetica, Geneva, sans-serif;" class="form-control" name="username" placeholder="Αναζήτηση">
</div>
</form>
</ul>
</div>
</div>
</nav>
Bellow is the carousel code
<div class="homeCarousel hidden-xs">
<div id="myCarousel" class="carousel slide" data-interval="3000" 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="active item">
<div class="carousel-caption">
<img src="images/thessaloniki1.jpg">
</div>
</div>
<div class="item">
<div class="carousel-caption">
<img src="images/alexander1.jpg">
</div>
</div>
<div class="item">
<div class="carousel-caption">
<img src="images/aristotelous1.jpg">
</div>
</div>
</div>
<a class="carousel-control left" href="#myCarousel" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left"></span></a>
<a class="carousel-control right" href="#myCarousel" data-slide="next">
<span class="glyphicon glyphicon-chevron-right"></span></a>
</div>
</div>
Both codes are not in the same file. They are in different files. All 4 carousels (one for every page i told you above) has the same code, the only difference is on image names and the carousel id ("homeCarousel", "prodCarousel" etc etc).
Any help is welcomed. Thanks in advance.

I had a similar issue on my page. The bootstrap navbar is placed along with the carousel on top of the page. When scrolling down the navbar gets position:fixed; . To avoid jumping I wrapped a container around my navbar, but noticed some flickering. I could resolve this my adding a higher z-index to the container, just make sure it's higher than the carousel, for example set the container to: position:relative; and z-index: 999;
Here is an example
https://jsfiddle.net/2xz4omLj/1/

I've put twitter bootstrap carousel along with the navbar-fixed-top on many websites and i don't get this error on any. This means that there is a problem inside your source code.
As you already realised it has to do with the carousel. If you delete it from your code, that bug won't appear, I did that with inspect element and the bug don't shows.
So, i think you should look for the problem inside the carousel code that you've placed on your website. The first thing that i see witch i know it is not good is that you've forced your carousel items to get 500px height. This is not a good thing because bootstrap does not work like that. You should use col-xs-12 class along with homeCarousel class, remove the item height and in the same time add the class img-responsive to all your images because they don't have that class currently. Twitter bootstrap is a responsive framework and you don't seem to understand that. Your carousel should contain images with the same size and they should be in a large scale to cover, probably at least 1200px width. So keep in mind, don't force any height, because responsive means that the width will fit and the height will autoset alone. Check again your ==**START**== carousel styles and remove the useless code and try to take advantage of bootstrap functions as they are, don't try to hack them very much because they are well done.
If this does not solve your problem, try to add a jsfiddle and i will edit it to work for you.

I found my solution here:
Bootstrap 3 Fixed Top Navbar 'Flickering' On Mobile Scrolling using jQuery One-Page Scrolling Effect
It doesn't tell you to which element you should apply the "backface-visibility: hidden". Initially I applied it to all elements, but this prevented the navbar-brand (which fell behind some other part of the navbar in my case) from being clickable. I ended up applying the backface-visibility to .navbar and some of my main containers.

Related

Bootstrap Carousel Buttons Are Having Problems

I am working on a website, and Twitter Bootstrap's carousel controls don't seem to be working. Clicking on indicators allows me to navigate, and the .carousel() function works, so the website scrolls through the images without any problems, but when I try to navigate using the buttons, I can move one image to either way, but after that clicking on the button just sends me back to the previous animation, before sending me to the slide I was already on. Here's my code
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div id="mainCarousel" class="carousel slide" data-ride="carousel" data-interval="6000">
<ol class="carousel-indicators">
<li data-target="mainCarousel" data-slide-to="0" id="cib1" class="active"></li>
<li data-target="#mainCarousel" data-slide-to="1" id="cib2"></li>
<li data-target="#mainCarousel" data-slide-to="2" id="cib3"></li>
<li data-target="#mainCarousel" data-slide-to="3" id="cib4"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="item active">
<img src="/res/img/carousel/image1.png" />
</div>
<div class="item">
<img src="/res/img/carousel/image2.png" />
</div>
<div class="item">
<img src="/res/img/carousel/image3.png" />
</div>
<div class="item">
<img src="/res/img/carousel/image4.png" />
</div>
</div>
<a class="left carousel-control" href="#mainCarousel" 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="#mainCarousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
<script>
$("#mainCarousel").carousel();
</script>
Sorry if I explained it badly. I can't give anything visual. It seems to only be a problem with the website I'm making, because the code snippet works perfectly on here. In short, the left navigation button, for instance, will take me to the left once, but every time I click it after that, it moves to the right with no animation, before sliding back to the left, leaving me on the same slide I started on.
EDIT:
I am using Angular JS with routing on the same website, so that might affect how the carousel works.
See if this works, you have a few small errors in your code. You added / after the the end of the img source, not sure why. You forgot a # before the first main carousel in your ordered list, and the script at the end is unnecessary. I have done this for you here: https://jsfiddle.net/owq0e5vv/ and it seems to work fine.
I discovered the answer with a different question. After remembering that I had Angular Routing, I could narrow my search. Here's the answer:
Bootstrap carousel not working with angularjs

Make bootstrap carousel image and text readable in mobile

My bootstrap carousel looks fine on desktop. The images are sized at 1200x400. But on mobile, it shrinks in so much that you can't ready the text on the images. Also, the navigation dots on the bottom of the player move up on top of the image.
1) How do I keep the size big enough to read the text on the images on mobile
2) How do I prevent the navigation dots on the bottom of the player from overlapping on my image on mobile
Here's my bootply:
http://www.bootply.com/huskydawgs/6UtgjHqm8f
Here's my html:
<div class="content-section-b">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
<!-- Indicators -->
<ol class="carousel-indicators">
<li data-target="#carousel-example-generic" data-slide-to="0" class="active"></li>
<li data-target="#carousel-example-generic" data-slide-to="1"></li>
</ol>
<!-- Wrapper for slides -->
<div class="carousel-inner" role="listbox">
<div class="item active">
<img class="img-responsive" src="http://www.onvia.com/responsive/apple_orange_testimonials.png" alt="Apples and Oranges">
</div>
<div class="item">
<img class="img-responsive" src="http://www.onvia.com/responsive/pears_mangos_testimonials.png" alt="Pears and Mangos">
</div>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#carousel-example-generic" 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="#carousel-example-generic" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
</div>
</div>
<!-- /.container -->
</div>
<!-- /.content-section-b -->
Here's my css:
.content-section-b {
padding: 50px 0;
background-color: #3C5A78;
}
.carousel-control.left {
background-image:none;
}
.carousel-control.right {
background-image:none;
}
The problem is with the source images: they make it seem as if they were two different carousel items, when are in fact only one (apple-orange & pear-mango)... For a quick fix, you could make individual images from the sources (one for each fruit), hide the regular carousel through media queries on xs screens, and have a visible-xs carousel which has 4 instead of 2 carousel items.
It's not a great solution, though.
Fast example: http://www.bootply.com/U5uYwmnt1g
EDIT
Added the CSS to move the navigation dots on mobile not to overlap with the slides.
Expanding on why it's not the best solution:
-You should make the elements of the carousel be html elements, for a start, and not rely completely on images with shapes and text inside (everything on your images can be replicated easily with CSS, using images only for the fruits, or for the fruits and the cirle, if you don't care to make the circle with CSS)
-Once this is done, you could skip the 2nd carousel and modify the content of each slide through media queries (or helper classes) to get the desired result
-The CSS for the navigation dots uses the max-width query, which I understand is not usually recomended, though in this case it might be well used (if somebody can expand on this, please do)

HTML/Bootstrap Table over flow and how workaround it

I have a form wherein the user may search for example a name. after searching a table will come out. It works perfectly in the desktop but as you know I used bootstrap and it is responsive and usable in a mobile device. Now when I adjust the window size the nav bar collapses, design changes and becomes a mobile version. But then the table cannot go as small as the screen and it causes overflow on the right side. It cant go smaller because the words are long and cant we word wrapped with space because there is no space. So how do I make my nav bar and footer stretch to the width of the overflow?here is my sample interface...
<nav class="navbar navbar-inverse navbar-static-top" style="">
<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="#">Envoy Search Rackings</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav">
<li class="<?php if(strpos($currentpage,"profile")==TRUE) {print $active;}
?>">Search Database</li>
<li class="<?php if(strpos($currentpage,"insert")==TRUE) {print $active;}
?>">Add Brochure</li>
<li>Export Data Modified</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><span class="glyphicon glyphicon-log-out"></span> Logout</li>
</ul>
</div>
</div>
</nav>
and here is my nav bar code. my footer has no content yet so i'll just copy the code from navbar to strech just in case. Thank you very much! sorry if i explained too long!
If anybody stumbles over this and just wants to make the table fit the device width:
Use
<div class="table-responsive"> ... </div>
around your <table> tags.
Not sure if this is what the OP wants, but I hope it helps anyone anyway :D
I wouldn't recommend stretching the nav and footer to full width as of table because user wouldn't be able see the menu button in the nav bar in first fold as it would be to the far right under scroll fold.
Basically for tables you will have to fix the container width to 100% and add overflow:auto scrollbar so user can scroll/slide just the table part to see more rather than the whole page.

How do I get collapsible navigation bar to work?

I'm using twitter bootstrap and I see the image below when I reduce the width of the browser window to a certain size. However, when I click on it and nothing happens. I normally have 2 elements there but can't see them when I width is too small. How do I fix this by either removing the button from showing or have the button show but then show the 2 items on click?
To stop the button from displaying, you may add below code to your css:
.navbar .btn-navbar{
display:none;
}
Additionally , you may go through this article for more information and help..
Make sure you have responsive bootstrap css and the collapse javascript plugin per the bootstrap documentation:
Heads up! The responsive navbar requires the collapse plugin and
responsive Bootstrap CSS file.
Also here is an example of it working (has bootstrap responsive css and bootstrap js referenced):
http://jsfiddle.net/ZdVcg/
<link href="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap-combined.min.css" rel="stylesheet">
<script src="//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/js/bootstrap.min.js"></script>
<div class="navbar">
<div class="navbar-inner">
<div class="container">
<!-- .btn-navbar is used as the toggle for collapsed navbar content -->
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<!-- Be sure to leave the brand out there if you want it shown -->
<a class="brand" href="#">Project name</a>
<!-- Everything you want hidden at 940px or less, place within here -->
<div class="nav-collapse collapse">
<!-- .nav, .navbar-search, .navbar-form, etc -->
<ul class="nav">
<li class="active">Home
</li>
<li>Link</li>
<li>Link</li>
</ul>
</div>
</div>
</div>
</div>​

Using Twitter Bootstrap Header Dropdown

I have designed a whole website using Twitter Bootstrap and it works very well for the most part. I have done quite a bit of CSS in the past but had never done a framework like this.
The main problem I have is that when the browser goes under 600px the and the header condenses into a dropdown (which I want) the dropdown goes behind images and some HTML elements such as text input boxes and other dropdown menus.
Is there any way to make this header dropdown menu opaque so that it is in front of every other element? I would provide some code but I am not sure specifically what part of the Twitter Bootstrap stylesheet would be helpful.
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand" href="/">Exployre</a>
<div class="nav-collapse">
<ul class="nav">
<li>Find</li>
<li>Share</li>
<li>Inspire</li>
<li>Discuss</li>
<li>Groups</li>
<li>Profile</li>
<li>About</li>
<li>
<form action="/search" class="navbar-search">
<div>
<input type="text" placeholder="Search" class="search-query pull-right" name="q" size="55" />
</div>
</form>
<script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script>
</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
I believe all of these classes are straight from the Twitter Bootstrap CSS without modification.
You probably have a z-index on your website content that is a higher value than the z-index defined for the Dropdowns.
If you're using the LESS version of Twitter Bootstrap, open variables.less and find the line containing #zindexDropdown (on line 144). The default setting is 1000, you can change it to a number that is higher than the z-index on your content.
If you're using the normal CSS, it is defined in the rule for .dropdown-menu (on line 2773).