html - How to animate a span becoming visible? -


using following css have cards, when hover on them show additional information using inside div. when div becomes bigger because div within existing div shown, color change animated, resizing of card beacause of info in not animate. solution?

/* geschiedeniskaart */     .geschiedeniskaart     {         width:350px;         background-color: #e0f0ff;         box-shadow: 3px 3px 1px #888888;         margin-top:20px;         margin-left:5px;         transition: 1s ease;     }  .geschiedeniskaartdatum {     width:350px;     background-color: #001433;     box-shadow: 3px 3px 1px #888888;     margin-top:20px;     margin-left:5px; }  .geschiedeniskaartdatum .tekst {     font-size:1.1 em;     margin-left:20px;     color: white;     line-height: 20px; }  .geschiedeniskaart .tekst{     font-size:.9 em;     margin-left:20px;     color: #00004c;     line-height: 20px; }  .geschiedeniskaart .visibletekst {     display:none;     transition: 1s ease; }  .geschiedeniskaart:hover {     background-color: white; }  .geschiedeniskaart:hover .visibletekst {     display: block;     line-height : 30px; } 

the html looks this:

<div class="geschiedeniskaart"> <div class="row"> <div class="col-xs-12"> <span class="tekst">title</span> </div></div>  <div class="row visibletekst"> <div class="col-xs-6"><span class="tekst">i visble when hovering on tittle</span></div><div class="col-xs-6"><span class="tekst">date</span></div></div></div> 

do way this.

$(document).ready(function(){    var dd = $('dd');    var dt = $('dt');    dd.hide();    $('dl').on('mouseenter','dt',function(){     $(this).next().slidedown(400);      $('h1').fadein(1000);      dt.mouseleave(function(){       $(this).next().slideup(400);        $('h1').fadeout(1000);        });      /*can following well:note event delegationxx      $('dl').on('mouseenter','dt',function(){     $(this).next()   .show(400).   siblings('dd').   hide();                   });*/          });   });    (function(){       $('<h1></h1>',{     text:"hover answers",     class: 'myclass'   }).prependto('body');  })();  $('h1').click(function(){        $(this).hide('slow', function() {      $(this).insertafter('p');    });      });
dl{padding:10px;text-align:center;background:silver;width:90%;margin:0 auto;border-radius:4px;}  dt{padding:5px;border:2px grey solid;font-size:2em;font-weight:bold;border-radius:5px;}  dd{font-size:1.5em;color:grey;}  h1 {font-size:1em;color:mediumpurple;}  .myclass{background:silver;text-align:center;}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>  <dl>    <dt>how bro</dt>    <dd>very nice, thank you<p></p></dd>    <dt>how bro</dt>    <dd>very nice, thank you</dd>    <dt>how bro</dt>    <dd>very nice, thank you</dd>    <dt>how bro</dt>    <dd>very nice, thank you</dd>      </dl>


Comments

Popular posts from this blog

javascript - Slick Slider width recalculation -

jsf - PrimeFaces Datatable - What is f:facet actually doing? -

angular2 services - Angular 2 RC 4 Http post not firing -