1

我添加到我的网站的传送带行为真的很奇怪。在2的周期中,幻灯片向上滑动。父div的高度变为0px,并且子div的边距变为负值。在bootstrap网站的例子中,这不会发生。我从bootstrap网站复制了最新的代码,找不到我做错了什么。问题bootstrap 3传送带更改高度为0px和marigin到-..... px

如果有人能帮助我,我会喜欢它。

http://humandemo.cloudaccess.host标题右侧在页面顶部。

代码使用:

<div class="container"> 
    <div id="myCarousel" class="carousel slide" data-ride="carousel"> 
     <!-- Carousel 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> 
     </ol> 
     <!-- Wrapper for carousel items --> 
     <div class="carousel-inner"> 
      <div class="item active"> 
       <img src="/images/page-specific/home/iPhone-Comp-hw.png" alt="Second Slide"> 
      </div> 
      <div class="item"> 
       <img src="/images/page-specific/home/iPhone-Comp-hw.png" alt="First Slide"> 
      </div> 
     </div> 
     <!-- Carousel controls --> 
     <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> 

回答

0

我想这是mootools-more.js的工作。此脚本包含the Fx.Slide class

幻灯片效果以水平或垂直方向滑动元素。内容将在内部折叠。

尝试对该脚本发表评论。

+1

我做了一些研究,确实mootools的冲突与bootstrap。 (函数($){ $(document).ready(function(){})每个(函数(索引,元素){ $(this)[index] .slide = null; } –

0

@Jeroen:我已经检查您的网站,并通过“检查元素”尝试了一些改变CSS和按我你应该检查DIV ID =“myCarousel”和DIV CLASS = “转盘-内部”。如果他们已经设置了一定的高度。希望这可以帮助你。

0

您的Bootsrap旋转木马代码是完美的,没有问题。你的另一个脚本可能存在问题,我已经在codepen中使用了你的代码,它的工作非常好。

+0

http://codepen.io/Samir_designer/pen/jrBLxE - 选中此codepen –

0

我在@Gleb Kemarsky的回答后做了一些研究,谢谢你。事实上自举MooTools的冲突,请参阅:https://github.com/joomla/joomla-cms/issues/475

修复的方法是:

if (typeof jQuery != 'undefined') { 
(function($) { 
$(document).ready(function(){ 
$('.carousel').each(function(index, element) { 
$(this)[index].slide = null; 
}); 
}); 
})(jQuery); 
}