Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

HTML Settings

Here you can Sed posuere consectetur est at lobortis. Donec ullamcorper nulla non metus auctor fringilla. Maecenas sed diam eget risus varius blandit sit amet non magna. Donec id elit non mi porta gravida at eget metus. Praesent commodo cursus magna, vel scelerisque nisl consectetur et.

            
              <div class="container">
  <div id="main_area">
    <!-- Slider -->
    <div class="row">
      <div class="col-xs-12" id="slider">
        <!-- Top part of the slider -->
        <div class="row">
          <div class="col-sm-8" id="carousel-bounding-box">
            <div class="carousel slide" id="myCarousel">
              <!-- Carousel items -->
              <div class="carousel-inner">
                <div class="active item" data-slide-number="0">
                  <img src="http://placehold.it/320x480&text=one"></div>

                <div class="item" data-slide-number="1">
                  <img src="http://placehold.it/770x300&text=two"></div>

                <div class="item" data-slide-number="2">
                  <img src="http://placehold.it/200x100&text=three"></div>

                <div class="item" data-slide-number="3">
                  <img src="http://placehold.it/770x300&text=four"></div>

                <div class="item" data-slide-number="4">
                  <img src="http://placehold.it/320x480&text=five"></div>

                <div class="item" data-slide-number="5">
                  <img src="http://placehold.it/770x300&text=six"></div>
              </div>
              <!-- Carousel nav -->
              <a class="left carousel-control" href="#myCarousel" role="button" data-slide="prev">
                <span class="glyphicon glyphicon-chevron-left"></span>
              </a>
              <a class="right carousel-control" href="#myCarousel" role="button" data-slide="next">
                <span class="glyphicon glyphicon-chevron-right"></span>
              </a>
            </div>
          </div>

          <div class="col-sm-4" id="carousel-text"></div>

          <div id="slide-content" style="display: none;">
            <div id="slide-content-0">
              <h2>Slider One</h2>
              <p>Lorem Ipsum Dolor</p>
              <p>This image is 320x480px</p>
              <p class="sub-text">October 24 2014 - <a href="#">Read more</a></p>
            </div>

            <div id="slide-content-1">
              <h2>Slider Two</h2>
              <p>Lorem Ipsum Dolor</p>
              <p>This image is 700x300px</p>
              <p class="sub-text">October 24 2014 - <a href="#">Read more</a></p>
            </div>

            <div id="slide-content-2">
              <h2>Slider Three</h2>
              <p>Lorem Ipsum Dolor</p>
              <p>This image is 200x100px</p>
              <p class="sub-text">October 24 2014 - <a href="#">Read more</a></p>
            </div>

            <div id="slide-content-3">
              <h2>Slider Four</h2>
              <p>Lorem Ipsum Dolor</p>
              <p>This image is 700x300px</p>
              <p class="sub-text">October 24 2014 - <a href="#">Read more</a></p>
            </div>

            <div id="slide-content-4">
              <h2>Slider Five</h2>
              <p>Lorem Ipsum Dolor</p>
              <p>This image is 320x480px</p>
              <p class="sub-text">October 24 2014 - <a href="#">Read more</a></p>
            </div>

            <div id="slide-content-5">
              <h2>Slider Six</h2>
              <p>Lorem Ipsum Dolor</p>
              <p>This image is 700x300px</p>
              <p class="sub-text">October 24 2014 - <a href="#">Read more</a></p>
            </div>
          </div>
        </div>
      </div>
    </div>
    <!--/Slider-->

    <div class="row hidden-xs" id="slider-thumbs">
      <!-- Bottom switcher of slider -->
      <ul class="hide-bullets">
        <li class="col-sm-2">
          <a class="thumbnail" id="carousel-selector-0"><img src="http://placehold.it/70x100&text=one"></a>
        </li>

        <li class="col-sm-2">
          <a class="thumbnail" id="carousel-selector-1"><img src="http://placehold.it/170x100&text=two"></a>
        </li>

        <li class="col-sm-2">
          <a class="thumbnail" id="carousel-selector-2"><img src="http://placehold.it/170x100&text=three"></a>
        </li>

        <li class="col-sm-2">
          <a class="thumbnail" id="carousel-selector-3"><img src="http://placehold.it/170x100&text=four"></a>
        </li>

        <li class="col-sm-2">
          <a class="thumbnail" id="carousel-selector-4"><img src="http://placehold.it/70x100&text=five"></a>
        </li>

        <li class="col-sm-2">
          <a class="thumbnail" id="carousel-selector-5"><img src="http://placehold.it/170x100&text=six"></a>
        </li>
      </ul>
    </div>
  </div>
</div>
            
          
!
            
                jQuery(document).ready(function($) {

    $('#myCarousel').carousel({
      interval: 5000
    });

    $('#carousel-text').html($('#slide-content-0').html());

    //Handles the carousel thumbnails
    $('[id^=carousel-selector-]').click(function() {
      var id = this.id.substr(this.id.lastIndexOf("-") + 1);
      var id = parseInt(id);
      $('#myCarousel').carousel(id);
    });

    // When the carousel slides, auto update the text
    $('#myCarousel').on('slid.bs.carousel', function(e) {
      var id = $('.item.active').data('slide-number');
      $('#carousel-text').html($('#slide-content-' + id).html());
    });
  });
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.

Console