css - Transitions when switching from top to bottom position -


if there's better way of doing i'm ask, please let me know, far best come with

i want have set of divs contain sliding div inside of them. sliding divs contain content pulled latest post. might not same height.

the start position have title showing, have whole div show when parent hovered over.

the problem i'm having using bottom position when screen gets thin, more title shows up. using top, lose of title, i'm willing sacrifice that.

so instead decided use both top , bottom, , flip auto in order make complete div show. (i don't want have sliding div same height containing div)

when though, transition doesn't work. tried using top, bottom, , in transition, it's same result - no transition.

can please explain a) why isn't working b) make work without going jquery.

html:

<div class="innerleftposts">     <div class="mainposthome">         <div class="postslidecover">             <h3>hello test</h3>             <p>this test content go in here , take space</p>         </div>     </div>     <div class="secondaryposthome">         <div class="postslidecover">             <h3>hello test</h3>             <p>this test content go in here , take space</p>         </div>     </div> </div> 

css:

.postslidecover{ width:calc(100% - 20px); height:auto; position:absolute;     transition:all 0.4s ease-out;     -webkit-transition:all 0.4s ease-out; } .mainposthome .postslidecover{     top:83%;     bottom:auto; }  .mainposthome:hover .postslidecover{     top:auto;     bottom:0; } 

fiddle full , visual example: https://jsfiddle.net/60nxpfs8/

here:

.postslidecover{     width:calc(100% - 20px);     height:auto;     position:absolute;     transition:all 0.4s ease-out;     -webkit-transition:all 0.4s ease-out;     bottom: 0; } .mainposthome .postslidecover{     transform: translatey(60%); }  .mainposthome:hover .postslidecover{     transform: translatey(0); } 

with jsfiddle

we can use transform property translatey use height of element metric move (100% relates 100% of element height). has added benefit of being able use hardware acceleration (as opposed software) animate.


Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -