Skip to main content
Inspiring
June 18, 2018
Answered

Carousel Fade-In effects

  • June 18, 2018
  • 1 reply
  • 1680 views

Hello, how to modify the carousel effect, for example fade-in

------------------------------------------------

Bonjour, comment modifier l'effet carousel, par exemple fade-in

    This topic has been closed for replies.
    Correct answer Nancy OShea

    no, unfortunately it does not work either. Today I received a Dreamweaver cc update, but without new Bootstrap 4.1

    Do you have a solution? Thank you in advance.-


    This  works for me.

    <!doctype html>

    <html lang="en">

    <head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <title>Bootstrap 4 - Carousel Fade </title>

    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M" crossorigin="anonymous">

    <style>

    body {

        padding-top: 3rem;

        padding-bottom: 3rem;

        color: #5a5a5a;

    }

    .carousel { margin-bottom: 4rem; }

    .carousel-caption {

        bottom: 3rem;

        z-index: 10;

    }

    .carousel-item {

        height: 32rem;

        background-color: #777;

    }

    .carousel-item > img {

        position: absolute;

        top: 0;

        left: 0;

        min-width: 100%;

        height: 32rem;

    }

    @media (min-width: 40em) {

    .carousel-caption p {

        margin-bottom: 1.25rem;

        font-size: 1.25rem;

        line-height: 1.4;

    }

    }

    /**Carousel Fade**/

    .carousel-fade .carousel-item {

    opacity: 0;

    transition-duration: .6s;

    transition-property: opacity;

    }

    .carousel-fade  .carousel-item.active,

    .carousel-fade  .carousel-item-next.carousel-item-left,

    .carousel-fade  .carousel-item-prev.carousel-item-right {

      opacity: 1;

    }

    .carousel-fade .active.carousel-item-left,

    .carousel-fade  .active.carousel-item-right {

    opacity: 0;

    }

    .carousel-fade  .carousel-item-next,

    .carousel-fade .carousel-item-prev,

    .carousel-fade .carousel-item.active,

    .carousel-fade .active.carousel-item-left,

    .carousel-fade  .active.carousel-item-prev {

    transform: translateX(0);

    transform: translate3d(0, 0, 0);

    }

    </style>

    </head>

    <body>

    <header>

    <nav class="navbar navbar-expand-md navbar-dark fixed-top bg-dark"> <a class="navbar-brand" href="#">Brand/Logo</a>

    <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation"> <span class="navbar-toggler-icon"></span> </button>

    <div class="collapse navbar-collapse" id="navbarCollapse">

    <ul class="navbar-nav mr-auto">

    <li class="nav-item active"> <a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a> </li>

    <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li>

    <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li>

    <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li>

    <li class="nav-item"> <a class="nav-link" href="#">Link</a> </li>

    </ul>

    </div>

    </nav>

    </header>

    <!--CACROUSEL-->

    <main role="main">

    <div id="myCarousel" class="carousel slide carousel-fade" data-ride="carousel" data-interval="5000">

    <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>

    <div class="carousel-inner">

    <div class="carousel-item active"> <img class="first-slide" src="https://placeimg.com/1500/200/nature" alt="First slide">

    <div class="container">

    <div class="carousel-caption text-left">

    <h1>Example headline.</h1>

    <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>

    <p><a class="btn btn-lg btn-primary" href="#" role="button">Sign up today</a></p>

    </div>

    </div>

    </div>

    <div class="carousel-item"> <img class="second-slide" src="https://placeimg.com/1500/200/arch" alt="Second slide">

    <div class="container">

    <div class="carousel-caption">

    <h1>Another example headline.</h1>

    <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>

    <p><a class="btn btn-lg btn-primary" href="#" role="button">Learn more</a></p>

    </div>

    </div>

    </div>

    <div class="carousel-item"> <img class="third-slide" src="https://placeimg.com/1500/200/tech" alt="Third slide">

    <div class="container">

    <div class="carousel-caption text-right">

    <h1>One more for good measure.</h1>

    <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>

    <p><a class="btn btn-lg btn-primary" href="#" role="button">Browse gallery</a></p>

    </div>

    </div>

    </div>

    </div>

    <a class="carousel-control-prev" href="#myCarousel" role="button" data-slide="prev"> <span class="carousel-control-prev-icon" aria-hidden="true"></span> <span class="sr-only">Previous</span> </a> <a class="carousel-control-next" href="#myCarousel" role="button" data-slide="next"> <span class="carousel-control-next-icon" aria-hidden="true"></span> <span class="sr-only">Next</span> </a> </div>

    </main>

    <!--latest jQuery 3-->

    <script src="https://code.jquery.com/jquery-3.2.1.min.js" integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4=" crossorigin="anonymous"></script>

    <!--Popper JS-->

    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.11.0/umd/popper.min.js" integrity="sha384-b/U6ypiBEHpOf/4+1nzFpr53nxSS+GLCkfwBdFNTxtclqqenISfwAzpKaMNFNmj4" crossorigin="anonymous"></script>

    <!--latest Bootstrap 4 JS-->

    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta/js/bootstrap.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1" crossorigin="anonymous"></script>

    </body>

    </html>

    I don't know if DW has updated to BS4.1.  I don't pay much attention as I get the versions I need directly from GetBootstrap or the . jQuery'CDN.

    1 reply

    Nancy OShea
    Community Expert
    Community Expert
    June 18, 2018

    If you are using Bootstrap 3x, this tutorial describes how to modify the default carousel slider to fade.

    Alt-Web Design & Publishing: Customizing Bootstrap's Carousel

    Live Demo

    Bootstrap 3.3.7 Custom Carousel with Fade

    Nancy O'Shea— Product User & Community Expert
    TypooAuthor
    Inspiring
    June 18, 2018

    Thanks Nancy for your answer, I have bootstrap 4.0.0 with Dreamweaver cc.

    Nancy OShea
    Community Expert
    Community Expert
    June 18, 2018

    Thank you for your reply. The site is not online yet. The problem is simple, I have Dreamweaver cc 2018 and I want to integrate the Carousel from the Bootstrap component of Dreamweaver cc 2018. But the Dreamweaver cc 2018 Carousel does not work. Does that mean you can not use the Dreamweaver cc 2018 carousel anymore? Dreamweaver cc 2018 is defective and Bootstrap components no longer work? I want to use Dreamweaver cc2018 without DIY if it's possible. Adobe is fixing this problem or not? Thank you in advance for your answer


    You cannot upload your work to a TEST folder on your server?

    The carousel should work.  If the component does not work at all,

    1) make sure your site is properly defined

    2) check your code for errors.   Window > Results > Validation.  

    3) ensure you have proper links to :

              Bootstrap CSS,

              jQuery JS,

              Popper JS

              Bootstrap JS in that order.

    Bootstrap requires some basic coding skills, especially if you plan to customize components.

    Nancy O'Shea— Product User & Community Expert