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 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.

Quick-add: + add another resource

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.

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 id="boxcontainer">
  <div class="boxes"></div>
  <div class="boxes"></div>
  <div class="boxes"></div>
  <div class="boxes"></div>
  <div class="boxes"></div>
</div>

<button onClick="document.getElementById('boxcontainer').classList.toggle('openbox')">Show/ Hide</button>
            
          
!
            
              #boxcontainer {
  display: flex;
}

#boxcontainer > div.boxes {
  margin-right: 10px;
  transition: all .5s;
}

#boxcontainer div.boxes {
  width: 70px;
  height: 70px;
  background: navy;
  -webkit-transform: translate3d(-100%, 0, 0);
  transform: translate3d(-100%, 0, 0);
  opacity: 0;
  margin-bottom: 1em;
}

#boxcontainer.openbox > div.boxes {
  -webkit-transform: translate3d(0, 0, 0);
  transform: translate3d(0, 0, 0);
  opacity: 1;
  transition: all .5s;
}
            
          
!
            
              function getcss3prop(cssprop) {
  var css3vendors = ['', '-moz-', '-webkit-', '-o-', '-ms-', '-khtml-']
  var root = document.documentElement

  function camelCase(str) {
    return str.replace(/\-([a-z])/gi, function(match, p1) { // p1 references submatch in parentheses
      return p1.toUpperCase() // convert first letter after "-" to uppercase
    })
  }
  for (var i = 0; i < css3vendors.length; i++) {
    var css3propcamel = camelCase(css3vendors[i] + cssprop)
    if (css3propcamel.substr(0, 2) == 'Ms') // if property starts with 'Ms'
      css3propcamel = 'm' + css3propcamel.substr(1) // Convert 'M' to lowercase
    if (css3propcamel in root.style)
      return css3propcamel
  }
  return undefined
}

var transitionDelay = getcss3prop('transition-delay')

var boxes = document.querySelectorAll('.boxes')
if (transitionDelay) {
  for (var i = 0; i < boxes.length; i++) {
    boxes[i].style[transitionDelay] = 0.5 * i + 's'
  }
}
            
          
!
999px
Loading ..................

Console