简体   繁体   English

引导轮播无法在Firefox中使用

[英]bootstrap carousel not working in firefox

in my site there is issue on carousel slider , it's only working on chrome, its not working on mozilla 在我的网站上,轮播滑块上有问题,它仅适用于chrome,不适用于mozilla

My live site url is: http://www.umzug-preise.com/home 我的实时网站网址是: http : //www.umzug-preise.com/home

I have used code as below. 我使用了如下代码。

<header id="myCarousel" class="carousel slide">
        <!-- 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>
            <li data-target="#myCarousel" data-slide-to="2"></li>
        </ol>

        <!-- Wrapper for Slides -->
        <div class="carousel-inner">
            <div class="item active">
                <!-- Set the first background image using inline CSS below. -->
                <div class="fill" style="background:url(images/slider1.jpg);"></div>

            </div>
            <div class="item">
                <!-- Set the second background image using inline CSS below. -->
                <div class="fill" style="background:url(images/slider2.jpg);"></div>

            </div>
         <!--   <div class="item">
                <div class="fill" style="background:url(images/slider1.jpg);"></div>

            </div>-->
        </div>

        <!-- Controls -->
        <a class="left carousel-control" href="#myCarousel" data-slide="prev">
            <span class="icon-prev"></span>
        </a>
        <a class="right carousel-control" href="#myCarousel" data-slide="next">
            <span class="icon-next"></span>
        </a>

    </header>

The probleme are container heights. 问题是容器的高度。 The .fill class does not have fixed height. .fill类没有固定的高度。 So .carousel-inner that has height: auto is getting height = 0 . 所以.carousel-inner具有height: auto正在获取height = 0 This is not working on IE either and I think by luck it works on chrome. 这在IE上也不起作用,我认为幸运的是它在chrome上有效。 You need to set 你需要设置

.carousel-inner{
     height: 100%;
}

In my case, I solved it by removing (or commenting out) these bootstrap.css lines: 就我而言,我通过删除(或注释掉)以下bootstrap.css行来解决此问题:

-webkit-perspective: 1000px;
    perspective: 1000px;

in class .carousel-inner > .item 在类.carousel-inner > .item

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

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