html - Laggy CSS animation -


i'm trying size container on site using css3-animation.

this container:

.new-place-wrapper {    background: #004682;    display: inline-block;    margin-top: 70px;    animation-name: newplace;    animation-duration: 1s;    animation-fill-mode: forwards;    animation-delay: 3s;    animation-timing-function: linear;    max-height: 0px;    padding: 0px 20px;    overflow: hidden;    position: relative;    z-index: 8888;  }    @keyframes newplace {    0% {      max-height: 0px;      padding: 0px 20px;    }    100% {      max-height: 9999px;      padding: 20px 20px;    }  }
<div class="new-place-wrapper" data-equalizer>    <div class="new-place-close"><i class="fa fa-times"></i></div>    <div class="inner-place-left" data-equalizer-watch>      <span>wir sind umgezogen!</span>      ab sofort finden sie uns hier:      <address>        <strong>company</strong><br>        street 123<br>        city<br><br>        phone      </address>    </div>    <div class="inner-place-right" data-equalizer-watch>      <a class="button radius" href="#">vcf-karte</a>    </div>  </div>

basically animation works quite fine there strange lagging @ beginning. firstly container gets higher juddering. after moment animation goes on smooth.

check out on here! (wait 5 seconds!)

decrease max height better see animation.

.new-place-wrapper {    background: #004682;    display: inline-block;    margin-top: 70px;    animation-name: newplace;    animation-duration: 1s;    animation-fill-mode: forwards;    animation-delay: 3s;    animation-timing-function: linear;    max-height: 0px;    padding:  0 20px;    overflow: hidden;    position: relative;    z-index: 8888;  }    @keyframes newplace {    0% {      max-height: 0px;    }    100% {      max-height: 309px;      padding-top: 20px;      padding-bottom:20px;    }  }
<div class="new-place-wrapper" data-equalizer>    <div class="new-place-close"><i class="fa fa-times"></i></div>    <div class="inner-place-left" data-equalizer-watch>      <span>wir sind umgezogen!</span>      ab sofort finden sie uns hier:      <address>        <strong>company</strong><br>        street 123<br>        city<br><br>        phone      </address>    </div>    <div class="inner-place-right" data-equalizer-watch>      <a class="button radius" href="#">vcf-karte</a>    </div>  </div>


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -