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

              
                <div id="stepsbar-wrap">
  <div id="stepsbar" class="stepsbar">
    <ol>
      <li class="active"><span>Step1 Details</span></li>
      
      <li ><span>Step2 Details</span></li>
      <li><span>Step3 Details</span></li>
      <li><span>Step4 Details</span></li>
      <li><span>Step5 Details</span></li>
    </ol>
  </div>        
</div>

<button id="btn1" class="btn"> Step back</button>
<button id="btn2" class="btn"> Next Step</button>
              
            
!

CSS

              
                @gray: #ccc;
@blue: #57AED1;
@green: #8BC53F;
.stepsbar {
  padding: 1em 0;
  width: 100%;
  
  ol {
    overflow: hidden;
    margin: 0;
    padding: 1em 0;
    list-style: none;
    line-height: 1.2;
    font-size: 1em;
    counter-reset: li;
    animation: chase 1s 1 forwards;
  }
  
  li {
    float: left;
    display: inline;
    position: relative;
    counter-increment: li;
    width: 18%;
    text-align: center;
    color: @gray;
    transition: all 0.5s ease;
    
    &:before {
      content: counter(li);
      position: relative;
      background-color: @gray;
      color: #fff;
      width: 1.5em;
      padding: .5em;
      margin: 0 auto .5em;
      border-radius: 100%;
      font-size: 0.9em;
      text-align: center;
      display: block;
      z-index: 2;
      border: 1px solid darken(@gray, 10%);
      box-shadow:0 0 2px 2px #fff;
      
      background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
      
      background-repeat: repeat;
      background-size: 20px 20px;
    }
    &:after {
      content: "";
      position: absolute;
      width: 100%;
      height: 10px;
      display: block;
      background: #ccc;
      z-index: 1;
      top: 50%;
      left: 50%;
      margin-top: -1.2em;
      
            background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.15) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.15) 50%, rgba(255, 255, 255, 0.15) 75%, transparent 75%, transparent);
      
      background-repeat: repeat-x;
      background-size: 20px 20px;
      
    }
    &:first-child {
      &.active {
        &:after { left: 50%;}
      }
    }
    
    &:last-child {
      &:after {
        display: none;
      }
    }
    
    &.done {
      color: @green;
      &:after { 
        width: 120%;
        background-color: @blue;
       animation: progress 0.3s linear 10;
      }
      &:before {
        background-color: @green;
        border-color: darken(@green, 10%);
        color: white;
      }
    }
    
    &.active {
      width: 28%;
      font-weight: bold;
      color: @blue;
      &:after { width: 80%;}
      &:before {
        background-color: @blue;
        border: 2px solid #fff;//darken(@blue, 10%);
        color: white;
        box-shadow: 0 0 0 2px @blue;
        animation: progress .5s linear infinite;
        animation-delay: 3s;
      }
    }
  }
  
} // .progress-bar

.btn {
  display: block;
  margin: 2em auto;
  font-size: 1em;
  padding: .7em 1.5em;
  border-radius: 5px;
  border: 1px solid grey;
  background: lightblue;
  cursor: pointer;
}
#btn1 { float: left;}
#btn2 { float: right;}

@keyframes chase {
  from {
    width: 80%;
  }
  to {
    width: 100%;
  }
}

@keyframes progress {
  to {background-position: 20px 0;}
}


              
            
!

JS

              
                var steps = $("#stepsbar li"), i = 0;

$("#btn2").click(function(){
  
  if(i < steps.length) {
    console.log("btn2 - "+i); steps.eq(i).removeClass().addClass('done').next().removeClass().addClass('active');
    i++;
  }
});


$("#btn1").click(function(){
  
  if(i <= steps.length && i > 0) {
    
    console.log("btn1 - "+i); steps.eq(i).removeClass().prev().removeClass().addClass('active');
    i--;
    
  }
});
              
            
!
999px

Console