简体   繁体   中英

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

My live site url is: 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. So .carousel-inner that has height: auto is getting height = 0 . This is not working on IE either and I think by luck it works on chrome. You need to set

.carousel-inner{
     height: 100%;
}

In my case, I solved it by removing (or commenting out) these bootstrap.css lines:

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

in class .carousel-inner > .item

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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