【发布时间】:2015-08-11 01:33:39
【问题描述】:
我使用 height 属性为我的 DIV 设置动画,它出现在另一个元素的悬停上 - 它从顶部“滚动”。有没有办法旋转动画,所以我会让它从下到上出现?
HTML:
<a href="#" class="show">SHOW IT</a>
<div id="appear">
<img src="http://data.atria.sk/matmenu/celevyk.jpg" />
</div>
CSS:
#appear {
width: 308px;
height: 0px;
overflow:hidden;
-webkit-transition: all 0.2s linear;
-moz-transition: all 0.2s linear;
-o-transition: all 0.2s linear;
transition: all 0.2s linear;
}
.show:hover + #appear, #appear:hover {
height: 331px;
}
【问题讨论】:
-
看起来类似于stackoverflow.com/questions/10247255/…。只需将该小提琴中的 .animate.move 更改为 animate.move { bottom: 100%;边距顶部:-100px; /*.animate width*/ } 不完全是您想要的,但可能会引导您朝着正确的方向前进
-
在不改变文档流的情况下使用绝对定位。
标签: css transition