how to make smooth css transition -
how can css transition example in here (the dropdown example), far i've managed change text , background color, not whole transition effect thing (where rectangle rolls when hovered , rolls smoothly when un-hovered), idea how can achieve it? here's code:
a.menulink { text-decoration: none; color: #000000; background-color: rgb(235,235,185); -webkit-transition: color .25s linear; transition: color .25s linear; transition: background-color .15s linear .1; } a.menulink:hover { text-decoration: none; color: #ffffff; background-color: rgb(255,24,24); -webkit-transition: color .25s linear, background-color .15s linear .1s; transition: color .25s linear, background-color .15s linear .1s; }
thank before
<a href="#" class="linkhover"> <span hover-title="link hover">link hover</span> </a> .linkhover { display: inline-block; overflow: hidden; perspective: 400px; -webkit-perspective: 400px; perspective-origin: 50% 50%; -webkit-perspective-origin: 50% 50%; } .linkhover span { display: block; position: relative; transition: 500ms ease; -webkit-transition: 500ms ease; transform-origin: 50% 0%; -webkit-transform-origin: 50% 0%; transform-style: preserve-3d; -webkit-transform-style: preserve-3d; } .linkhover:hover span { transform: translate3d( 0px, 0px, -35px ) rotatex( 90deg ); -webkit-transform: translate3d( 0px, 0px, -35px ) rotatex( 90deg ); } .linkhover span:after { content: attr(hover-title); display: block; position: absolute; left: 0; top: 0; white-space: nowrap; color: white; background: red; transform-origin: 50% 0%; -webkit-transform-origin: 50% 0%; transform: translate3d( 0px, 100%, 0px ) rotatex( -90deg ); -webkit-transform: translate3d( 0px, 100%, 0px ) rotatex( -90deg ); }
Comments
Post a Comment