html - Make notification bar slide up from the bottom -


i have small horizontal notification bar slides bottom of page.

it comes fine, when open page flashes, disappears , slides up.

how modify doesn't appear/disappear before transition takes place?

#notificationbarbottom {    position: fixed;    z-index: 101;    bottom: 0;    left: 0;    right: 0;    background: #5cb85c;    color: #ffffff;    text-align: center;    line-height: 2.5;    overflow: hidden;    -webkit-box-shadow: 0 0 5px black;    -moz-box-shadow: 0 0 5px black;    box-shadow: 0 0 5px black;  }  @-webkit-keyframes slidedown {    0%, 100% {      -webkit-transform: translatey(0px);    }    10%,    90% {      -webkit-transform: translatey(510px);    }  }  @-moz-keyframes slidedown {    0%, 100% {      -moz-transform: translatey(0px);    }    10%,    90% {      -moz-transform: translatey(510px);    }  }  .cssanimations.csstransforms #notificationbarbottom {    -webkit-transform: translatey(510px);    -webkit-animation: slidedown 2.5s 1.0s 1 ease forwards;    -moz-transform: translatey(510px);    -moz-animation: slidedown 2.5s 1.0s 1 ease forwards;  }
<div id="notificationbarbottom">hello, human!</div>

jsfiddle demo here: https://jsfiddle.net/cnfk36jd/ (but unfortunately problem not visible there). here's page can see "flickering" http://www.whycall.me/bannertest.html

i tried advice here: https://css-tricks.com/pop-from-top-notification/ , tweaked translatey values quite bit, doesn't help, not sure else do.

thank help

the elements initial position visible, , then, during page load, first translate kicks in hide it, hence flickers.

do this, place below bottom, bottom: -510px;, , slide up.

updated fiddle: https://jsfiddle.net/cnfk36jd/1/

#notificationbarbottom {      position: fixed;      z-index: 101;      bottom: -510px;      left: 0;      right: 0;      background: #5cb85c;      color: #ffffff;      text-align: center;      line-height: 2.5;      overflow: hidden;      box-shadow:         0 0 5px black;  }  @keyframes slidedown {      0% { transform: translatey(0px); }      100% { transform: translatey(-510px); }  }  #notificationbarbottom {      animation: slidedown 2.5s ease forwards;  }  #close {    display: none;  }
<div id="notificationbarbottom">hello, human!</div>

side note: temporary removed prefixed properties, need add them back


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -