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.

            
              <div class="tricker">
  <h2>Hey I'm first Here</h2>
  <h2>Me, the second</h2>
  <h2>And I am the Third!</h2>
</div>
<div class="subline"></div>
<p>Hello, It's the text rotater here. <br> Hope you like it.</p>
            
          
!
            
              .tricker {
  height: 50px;
  overflow: hidden;
  margin: 100px auto 20px;
}
.tricker h2 {
  color: #333;
  margin: 0;
  height: 50px;
  line-height: 50px;
  font-size: 40px;
  text-align: center;
  text-transform: uppercase;
  transition: margin-top .3s ease;
}
.subline {
  width: 100px;
  height: 2px;
  margin: 10px auto;
  background-color: #181818;
}
p {
  text-align: center;
  line-height: 26px;
  color: #676665;
  font-size: 18px;
}
            
          
!
            
              (function($) {
  var duration = 2500;  // change this to change rotation time in milliseconds
  var current = 1;
  var tricker = $(".tricker");
  var height = tricker.height();
  var number = tricker.children().length;
  var first = tricker.children().first();

  setInterval(function() {
    var interv = current * -1 * height;
    first.css("margin-top", interv + "px");
    if (current == number) {
      first.css("margin-top", "0px");
      current = 1;
    } else {
      current++;
    }
  }, duration);
})(jQuery);
            
          
!
999px
Loading ..................

Console