简体   繁体   English

Twitter Bootstrap Carousel错位每个幻灯片过渡

[英]Twitter Bootstrap Carousel Misaligning each Slide Transition

I integrated the Bootstrap Carousel ( http://getbootstrap.com/examples/carousel/ ) in my 'comingsoon' homepage: http://247tutors.net/comingsoon/index.html 我将Bootstrap Carousel( http://getbootstrap.com/examples/carousel/ )集成到了'comingsoon'主页中: http ://247tutors.net/comingsoon/index.html

If you wait for the page to fully load, you will see that the automated slide transitions are not aligning properly (problem occurring in Chrome and Firefox). 如果您等待页面完全加载,则会看到自动幻灯片切换未正确对齐(Chrome和Firefox中出现问题)。 Each new slide comes in at a level and then once slide/img is covering carousel, ie, at the end of the slide transition, the slide drops down by ~10px. 每张新幻灯片都放入一个级别,然后一旦幻灯片/ img覆盖了轮播,即在幻灯片过渡结束时,幻灯片会下降〜10px。

Notice my carousel's side panels onHover, leave a gap of about the same amount of pixels at the bottom. 请注意,我的旋转木马的侧面板位于悬停位置,底部留有大约相同数量的像素。

..Can't tell it the error is caused by the navbar css (although, I do have the carousel-style.css being pulled in on the index.html after all other relevant css files (thus, giving carousel-style.css precedent over the class & div settings), or possibly, the error stems from loginDropdown.css ( http://247tutors.net/comingsoon/css/loginDropdown.css )..? ..无法说出错误是由导航栏css引起的(尽管,我确实在所有其他相关css文件之后将carousel-style.css插入了index.html中(因此,给出了carousel-style.css类或div设置的先例),或者错误可能是由于loginDropdown.css( http://247tutors.net/comingsoon/css/loginDropdown.css )..?

Full source code url: view-source: http://247tutors.net/comingsoon/index.html 完整的源代码URL:查看源代码: http : //247tutors.net/comingsoon/index.html

My Carousel css is here: http://247tutors.net/comingsoon/css/carousel-style.css 我的旋转木马CSS在这里: http : //247tutors.net/comingsoon/css/carousel-style.css

Carousel region snippet from index.html: 来自index.html的轮播区域摘要:

<script type="text/javascript">var switchTo5x=true;</script>
<div id="myCarousel" class="carousel slide" data-ride="carousel">
  <div class="carousel-inner">
    <div class="item active">
      <img src="images/slider/custom/main/a-advanced.png" alt="Advanced Subjects">          
      <div class="container">
        <div id="custom247slider" class="carousel-caption">
          <h1 id="textNormal">Advanced Subjects</h1>
          <h4 id="textNormal">We specialize in college
          <br />
          courses and above.
          </h4>
        </div> <!-- END carousel-caption -->
      </div> <!-- END container -->
    </div> <!-- END item active -->
    <div class="item">
      <img src="images/slider/custom/main/a-available.png" alt="Tutors Available 247">
      <div class="container">
        <div id="custom247slider" class="carousel-caption">
          <h1 id="textNormal" style="color:#222;">24&#47;7 Availability</h1>
          <h4 id="textNormal" style="color:#222;">Tutors whenever you need.</h4>
        </div> <!-- END carousel-caption -->
      </div> <!-- END container -->
    </div> <!-- END item -->
    <div class="item">
      <img src="images/slider/custom/main/a-economical.png" alt="Affordable Pricing">
      <div class="container">
        <div id="custom247slider" class="carousel-caption">
          <h1 id="textNormal">Economical</h1>
          <h4 id="textNormal">Pay by the minute, the
          <br />
          week, or the month.</h4>
        </div> <!-- END carousel-caption -->
      </div> <!-- END container -->
    </div> <!-- END item -->
    <div class="item">
      <img src="images/slider/custom/main/a-ivy.png" alt="Ivy League-level Tutoring">
      <div class="container">
        <div id="custom247slider" class="carousel-caption">
          <h1 id="textNormal">Exceptional Tutors</h1>
          <h4 id="textNormal">College graduates from top schools
          <br />
          in a wide range of disciplines.
          </h4>
        </div> <!-- END carousel-caption -->
      </div> <!-- END container -->
    </div> <!-- END item -->

  </div> <!-- END carousel-inner -->
  <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> <!-- END myCarousel -->

You have to remove the absolute positioning of the .carousel-inner > .item > img class on line 11 of your carousel-style.css style sheet. 您必须在carousel-style.css样式表的第11行中删除.carousel-inner> .item> img类的绝对位置。 It should remove the skipping effect! 它应该消除跳过效果! ;) ;)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM