したがって、Googleで簡単に検索すると、次のことが明らかになりました。
.our_content {
/* Initially we don't want any height, and we want the contents to be hidden */
max-height: 0;
overflow: hidden;
/* Set our transitions up. */
-webkit-transition: max-height 0.8s;
-moz-transition: max-height 0.8s;
transition: max-height 0.8s;
}
.outside_box:hover .our_content {
/* On hover, set the max-height to something large. In this case there's an obvious limit. */
max-height: 200px;
}
js でクリックすると、クラスを変更して適用する必要があります。あなたのアニメーションがどれだけ洗練されている必要があるのか知りたいです。それらを磨く必要がある場合は、フェードとサイズ変更を使用することをお勧めします.
tr {
max-height: 0;
overflow: hidden;
-webkit-transition: max-height 360ms;
}
tr.selected {
-webkit-animation:
grow 420ms ease-in-out,
fadeIn 540ms ease-in;
}
tr.deslection {
-webkit-animation:
shrink 420ms ease-in-out,
fadeOut fadeIn 540ms ease-out;
}
@-webkit-keyframes grow {
0% {
max-height: /*initial row height*/;
}
100% {
max-height: /*new row height*/;
}
}
@-webkit-keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
@-webkit-keyframes shrink {
0% {
max-height: /*new row height*/;
}
100% {
max-height: /*initial row height*/;
}
}
@-webkit-keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
}
}
jsでクラスを追加したり削除したりすることを理解しているように聞こえるので、それについては説明していません。追加のヘルプが必要な場合は、コードを投稿してください。幸運を!