Pen Settings

HTML

CSS

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

JavaScript

Babel includes JSX processing.

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

Packages

Add Packages

Search for and use JavaScript packages from npm here. By selecting a package, an import statement will be added to the top of the JavaScript editor for this package.

Behavior

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.

Format on Save

If enabled, your code will be formatted when you actively save your Pen. Note: your code becomes un-folded during formatting.

Editor Settings

Code Indentation

Want to change your Syntax Highlighting theme, Fonts and more?

Visit your global Editor Settings.

HTML

              
                <h2 class="text-center">Bootstrap carousel in popover</h2>
<h3 class="text-center">This feature does not exist in official Bootstrap</h3>
<div>
  <input class="input-carousel" type="text" placeholder="carousel on click in popover..." data-content='<div id="myCarousel" class="carousel slide" data-interval="true">
                 <!-- Indicators -->         
                <div class="carousel-inner">           
                    <div class="item active">
                        <blockquote>
                          <p>First Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
                          <small>Someone famous in <cite title="Source Title">Source Title</cite></small>
                        </blockquote>
                    </div>
                    <div class="item">
                        <blockquote>
                          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
                          <small>Someone famous in <cite title="Source Title">Source Title</cite></small>
                        </blockquote>
                     </div>  
                    <div class="item">
                        <blockquote>
                          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
                          <small>Someone famous in <cite title="Source Title">Source Title</cite></small>
                        </blockquote>
                    </div>                                                                                   
                </div> 
               <div class="carousel-controls">
                  <a class="carousel-control left" href="#myCarousel" data-slide="prev"><span class="fa fa-angle-double-left"></span></a>
                  <a class="carousel-control right" href="#myCarousel" data-slide="next"><span class="fa fa-angle-double-right"></span></a>
              </div>               
                                                            
            </div><!-- End Carousel -->  
    '>


  <button type="button" class="btn btn-default" data-toggle="tooltip" title="tooltip on top..">tooltip on top</button>

  <input class="hover" type="text" placeholder="popover on hover and click.." data-content='<div>
      text text
      <br />
      <h1>Title</h1>
      <div>Lorem ipsum dolor sit amet, consectetur <span class="green">adipisicing</span> elit. Esse quidem perferendis exercitationem cumque mollitia autem consectetur incidunt!</div>      
    </div>
    '>
  <input class="opened" type="text" placeholder="initially opened.." data-content='<div id="myCarousel" class="carousel slide" data-interval="true">
                 <!-- Indicators -->         
                <div class="carousel-inner">           
                    <div class="item active">
                        <blockquote>
                          <p>First Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
                          <small>Someone famous in <cite title="Source Title">Source Title</cite></small>
                        </blockquote>
                    </div>
                    <div class="item">
                        <blockquote>
                          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
                          <small>Someone famous in <cite title="Source Title">Source Title</cite></small>
                        </blockquote>
                     </div>  
                    <div class="item">
                        <blockquote>
                          <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
                          <small>Someone famous in <cite title="Source Title">Source Title</cite></small>
                        </blockquote>
                    </div>                                                                                   
                </div> 
               <div class="carousel-controls">
                  <a class="carousel-control left" href="#myCarousel" data-slide="prev"><span class="fa fa-angle-double-left"></span></a>
                  <a class="carousel-control right" href="#myCarousel" data-slide="next"><span class="fa fa-angle-double-right"></span></a>
              </div>               
                                                            
            </div><!-- End Carousel -->  
    '>
  <br />

  <input class="btn btn-warning input-carousel-2" type="button" value="click me" >
</div>


<div class="author">Made with ♥ by <a href="https://dankoknad.github.io/" target="_blank">Danko</a></div>  
</div>
              
            
!

CSS

              
                /* 
Author: Danko Milutinovic
Desctiption: Carousel in popover - Bootstrap
Contact:  
        https://danko-m.github.io/ ,
        dankomilutinovic@gmail.com, 
        https://rs.linkedin.com/pub/danko-milutinovic/a3/675/778         
*/

body {
  padding-top: 100px;
}
h3 {
  margin-bottom: 50px;
}
div {
  text-align: center;
}

input {
  padding: 4px 10px 5px;
  margin: 10px 0;
}

.green {
  color: green;
  font-weight: bold;
}

.carousel-control span {
  position: absolute;
  bottom: 0;
  color: olive;
}

.carousel-control.left,
.carousel-control.right {
  background: none !important;
  filter: progid: none !important;
}
.fa-angle-double-left {
  left: 5px !important;
}
#myCarousel .carousel-inner {
  min-height: 190px;
}

#myCarousel p,
#myCarousel-2 p {
  text-align: left;
}

blockquote {
  background: #f9f9f9;
  border-left: 2px solid rgba(255,165,0,0.33);
}

.popover {
  border: 2px solid rgba(255, 158, 0, 1);
}

.popover.bottom>.arrow {
  border-bottom-color: rgba(255, 158, 0, 1);
}

.popover.bottom>.arrow:after {
  top: 3px;
}
.author {
  padding-bottom: 20px;
  margin-top: 100px;
  text-align: center;
  font-size: 14px;
}
              
            
!

JS

              
                $(function(e) {
  e.preventDefault;

  // tooltip for the button
  $('[data-toggle="tooltip"]').tooltip({
    placement: "top",
    trigger: "hover"
  });

  // popover for the third input in the first row
  $('.hover').popover({
    html: true,
    trigger: "hover click",
    placement: "bottom"
  });

  // popover for the last input in the first row
  $('.opened').popover({
    html: true,
    trigger: 'click',
    animate: false,
    placement: "bottom"
  }).popover('show');

  // initialize carousel in the first input / popover 
  $('.input-carousel').popover({
    html: true,
    trigger: "click",
    placement: "bottom"
  });

  // initialize carousel in the lower input / popover (html is inside js)  
  $('.input-carousel-2').popover({
    html: true,
    trigger: "click",
    placement: "bottom",
    content: "" +
      '<div id="myCarousel-2" class="carousel slide" data-interval="true"> ' +
      '<!-- Indicators -->' +
      '<div class="carousel-inner">' +
      '<div class="item active">' +
      '<blockquote>' +
      '<p>2th Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>' +
      '<small>Someone famous in <cite title="Source Title">Source Title</cite></small>' +
      '</blockquote>' +
      '</div>' +
      '<div class="item">' +
      '<blockquote>' +
      '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>' +
      '<small>Someone famous in <cite title="Source Title">Source Title</cite></small>' +
      '</blockquote>' +
      '</div>' +
      '<div class="item">' +
      '<blockquote>' +
      '<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>' +
      '<small>Someone famous in <cite title="Source Title">Source Title</cite></small></blockquote>' +
      '</div>' +
      '</div>' +
      '<div class="carousel-controls">' +
      '<a class="carousel-control left" href="#myCarousel-2" data-slide="prev"><span class="fa fa-angle-double-left"></span></a>' +
      '<a class="carousel-control right" href="#myCarousel-2" data-slide="next"><span class="fa fa-angle-double-right"></span></a>' +
      '</div>' +
      '</div>' +
      '<!-- End Carousel -->'
  });

  // initialize carousel in the first input / popover 
  $('.input-carousel, .opened').on('shown.bs.popover', function() {
    $('#myCarousel').carousel({
      interval: 3000
    });
  });

  // initialize carousel in the lower input / popover 
  $('.input-carousel-2').on('shown.bs.popover', function() {
    $('#myCarousel-2').carousel({
      interval: 2000
    });
  });

  // close previously opened popovers by clicking outside them
  $(document).on('click', function(e) {
    $('input').each(function() {
      if (!$(this).is(e.target) && $(this).has(e.target).length === 0 && $('.popover').has(e.target).length === 0) {
        $(this).popover('hide');
      }
    });
  });

});
              
            
!
999px

Console