cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External CSS

These stylesheets will be added in this order and before the code you write in the CSS editor. You can also add another Pen here, and it will pull the CSS from it. Try typing "font" or "ribbon" below.

Quick-add: + add another resource

Add External JavaScript

These scripts will run in this order and before the code in the JavaScript editor. You can also link to another Pen here, and it will run the JavaScript from it. Also try typing the name of any popular library.

Quick-add: + add another resource

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.

            
              .container
  .row
    .col-sm-2
      .well
    .col-sm-10
      .well
        h1#tour-step2 Lorem ipsum.
        <div id="tour-step1" class="panel panel-default">
          <div class="panel-heading">
            <h3 class="panel-title">Panel title</h3>
          </div>
          <div class="panel-body">
            Panel content
          </div>
        </div>



#tour-step1-info.hidden
  p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Reiciendis, earum!

#tour-step2-info.hidden
  p Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ullam excepturi, porro ipsa magnam, consequuntur quia.



#modal.modal.fade
  .modal-dialog
    .modal-content
      .modal-header
        button.close type="button" data-dismiss="modal"
          span aria-hidden="true" &times;
          span class="sr-only" Close
        h4.modal-title Modal title
      .modal-body
        p Something awesome has changed in this site. Start tour to get a guided introduction.
      .modal-footer
        button.btn.btn-default data-dismiss="modal" No Thanks
        button#start.btn.btn-primary autofocus="autofocus" data-dismiss="modal" Start tour
      
        
        
            
          
!
            
              body {
  margin: 0;
  padding: 0;
}
.well {
  height: 100vh;
}

.popover {
  .mm_actions {
    .btn.pull-right {
      margin-right: 5px;
      &:first-child {
        margin-right: 0;
      }
    }
  }
}
            
          
!
            
              var GuidedTour = function (steps, options) {
  $(document)
    .on('click', '[data-toggle=popover]', function () {
      var $context = $($(this).data('target')).popover('show');
      var scrollTop = $context.data('bs.popover').$tip.offset().top - $(window).height() / 2;
    $('html, body').clearQueue().animate({scrollTop: Math.max(scrollTop, 0)}, 'fast');
      return false;
    })
    .on('click', '[data-dismiss="popover"]', function () {
      $(this).closest('.popover').data('bs.popover').hide();
      return false;
    });

  return {
    start: function () {
      var toursteps = [];
      var defaults = {
        html: true,
        placement: 'auto top',
        container: 'body',
        trigger: 'manual'
      };
      var opts = $.extend(defaults, options);
      $(steps).each(function (i, step) {
        if (step.target) {
          var $target = $(step.target);
          if (!$target.length) {
            console.warn('Target not found', $target);
            return;
          }
          if (step.content instanceof $) step.content = step.content.html();
          var content = step.content;
          step.content = function () {
            var out = content;
            out += '<div class="mm_actions clearfix">';
            if (i + 1 < steps.length) {
              out += '<button type="button" class="btn btn-primary pull-right" autofocus data-dismiss="popover" data-toggle="popover" data-target="'+steps[i + 1].target+'">Next</button>';
            }
            out += '<button type="button" class="btn btn-default pull-right" data-dismiss="popover">Close</button>';
            out += '</div>';
            return out;
          }
          toursteps.push($target.popover($.extend(opts, step)));
        }
      });
      
      if (toursteps[0]) toursteps[0].popover('show');
    }
  }
};

$('#modal').modal();
  

$('#modal #start').click(function () {
  var tour = GuidedTour([
    {
      target: '#tour-step1',
      title: 'my title',
      placement: 'bottom',
      content: $('#tour-step1-info'),
    },
    {
      target: '#tour-step2',
      title: 'my title 2',
      placement: 'left',
      content: $('#tour-step2-info')
    },
    {
      target: '.container',
      placement: 'bottom',
      title: 'my title',
      content: 'Moep'
    },
  ]);

  tour.start();
});
            
          
!
999px
Loading ..................

Console