code: function toggleSlideEl (el) {
    var el_max_height = 0;
  
    if (el.getAttribute('data-max-height')) {
      // we've already used this before, so everything is setup
      if (el.style.maxHeight.replace('px', '').replace('%', '') === '0') {
        el.style.maxHeight = el.getAttribute('data-max-height');
        el.style.opacity = 1;
      } else {
        el.style.maxHeight = 0;
        el.style.opacity = 0;
      }
    } else {
      el_max_height = getHiddenElementHeight(el) + 'px';
      //el.style['-webkit-transition'] = 'background 0.5a linear, max-height 0.5s ease-in-out';
      el.style['-webkit-transition'] = 'opacity 0.5s ease-out, max-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1)';
      el.style.transition = 'opacity 0.5s ease-out, max-height 0.5s cubic-bezier(0.165, 0.84, 0.44, 1)';
      el.style.overflowY = 'hidden';
      el.style.maxHeight = '0';
      el.setAttribute('data-max-height', el_max_height);
      el.style.display = 'block';
  
      // we use setTimeout to modify maxHeight later than display (to we have the transition effect)
      setTimeout(function () {
        el.style.maxHeight = el_max_height;
        el.style.opacity = 1;
      }, 10);
    }
  }
docs: https://stackoverflow.com/a/3797442/2835973