Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Parallex effect on silde

HI,

I want to make a paralex effect on bootstrap carousel. I did it before on static, i did it time ago , and now how do i do it ? : p Heres my code :

<?php include 'includes/header.php' ?>

    <div class="object">
        <div class="carousel slide" id="index-carousel">

            <!-- Indicators -->
                <ol class="carousel-indicators">
                    <li class="active" data-slide-to="0" data-target="#index-carousel"></li>
                    <li data-slide-to="1" data-target="#index-carousel"></li>
                    <li data-slide-to="2" data-target="#index-carousel"></li>
                </ol>

            <!-- Wrapper for Slides -->
                <div class="carousel-inner">

                    <div class="item active" id="slide1">
                        <div class="carousel-caption">
                            <h2>Welcome to</h2>
                            <h2><?php echo $companyName; ?></h2>
                        </div><!-- /carousel-caption -->
                    </div><!-- /slide1 -->

                    <div class="item" id="slide2">
                        <div class="carousel-caption">
                            <h4>iPhones</h4>
                        </div><!-- /carousel-caption -->
                    </div><!-- /slide2 -->

                    <div class="item" id="slide2">
                        <div class="carousel-caption">
                            <h4>iPhones</h4>
                        </div><!-- /carousel-caption -->
                    </div><!-- /slide2 -->

                  </div><!-- /carousel-inner -->

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

          </div><!-- /index-carousel -->
    </div><!-- /object -->


    <div class="row bar">
        <div class="container">

        </div><!-- /container -->
    </div><!-- 

<?php include 'includes/footer.php' ?>
  .object{
  height:100%;
  width:100%;
  background-attachment: fixed;
  background-size: cover;
}

1 Answer

You could follow this guide to achieve a parallax effect on a slide :) http://tympanus.net/codrops/2012/04/30/fluid-css3-slideshow-with-parallax-effect/

It's a nicely explained tutorial.

Thank you :D

I think the code i pasted wokrked on images, but not on slide xd i forgot a bit : p