2013-05-05 98 views
-2

我遇到了Bootstrap旋转木马的问题:当幻灯片比Carousel div宽时,最后一张幻灯片与第一张幻灯片重叠。Twitter Bootstrap旋转木马:最后一张幻灯片与第一张幻灯片重叠

的jsfiddle,描绘了问题(向前滚动,看最后一张幻灯片如何重叠第一)

jsfiddle

"Links to jsfiddle must be accompanied be a code" 

此外,我注意到了这一点刚才,在第一时间之后的情况下,传送带从上次滑动到第一次滑动,传送带指示器停止突出显示当前的滑动编号。

我在做什么错?

回答

0

好吧,我已经在this answer的帮助下解决了这个问题。

底线是,我推<img> ES到CSS背景为每个.carousel .item和应用以下csses:

.carousel .item { 
    background-position: center center; 
    background-repeat: no-repeat; 
    /* background-size: cover; */ /* I don't wanna (up|down)scale */ 
    height: 510px; /* fixed height of the background images */ 
} 

#carousel-item-1 { 
    background-image: url(myImage.jpg); 
} 

#carousel-item-2 { 
    background-image: url(myImage.jpg); 
} 

#carousel-item-3 { 
    background-image: url(myImage.jpg); 
} 

一个愉快的副作用是,它也中心水平和垂直方向的图像(作物他们),我也需要。

我认为这样做是正确的做法,我应该从一开始就使用它。但我并不喜欢固定的,手写的height: 510px。我认为它会引起一些头痛,但以及...

0

在引导3的情况下,我使用旧的jQuery版本(1.7)时有同样的问题。 Bootstrap 3的jQuery应该是1.9.1或更新的。

相关问题