Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
376 views
in Technique[技术] by (71.8m points)

javascript - Bootstrap 4 carousel responsive issue in chrome

I have an issue with Bootstrap 4 carousel in Chrome only.

Here is my code:

  <div id="carouselExampleIndicators" class="carousel slide" data-ride="carousel">
  <ol class="carousel-indicators">
<li data-target="#carouselExampleIndicators" data-slide-to="0" class="active"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="1"></li>
<li data-target="#carouselExampleIndicators" data-slide-to="2"></li>
</ol>
<div class="carousel-inner" role="listbox">
<div class="carousel-item active">
     <img class="d-block img-fluid" src="http://placehold.it/1350x350" alt="First slide">
  </div>
   <div class="carousel-item">
  <img class="d-block img-fluid" src="http://placehold.it/1350x350" alt="Second slide">
</div>
<div class="carousel-item">
  <img class="d-block img-fluid" src="http://placehold.it/1350x350" alt="Third slide">
</div>
</div>
   <a class="carousel-control-prev" href="#carouselExampleIndicators" role="button" data-slide="prev">
  <span class="carousel-control-prev-icon" aria-hidden="true"></span>
  <span class="sr-only">Previous</span>
 </a>
 <a class="carousel-control-next" href="#carouselExampleIndicators" role="button" data-slide="next">
   <span class="carousel-control-next-icon" aria-hidden="true"></span>
    <span class="sr-only">Next</span>
   </a> 
 </div>

Here is my fiddle:

https://jsfiddle.net/benjamin_edwards/1gx43oph/

and here is an image of what the issue is:

See here

As you can see the left pane is Chrome and right is Safari. Only Chrome has the blooming issue - has anyone experienced this before?

Cheers,

Ben.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

OK so I have been searching the web and there is a solution for this

.carousel-item.active,
.carousel-item-next,
.carousel-item-prev{
 display:block !important;
}

I have updated my fiddle here:

https://jsfiddle.net/benjamin_edwards/1gx43oph/

and I got the answers from here:

https://github.com/twbs/bootstrap/issues/21611

from my post here:

https://github.com/twbs/bootstrap/issues/21966

Hope this can help others :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...