【发布时间】:2017-04-20 21:28:52
【问题描述】:
我有以下设置:
<div class="" style="height: 400px !important;
width: 100% !important;
overflow: hidden;">
<div class="" style="height: 400px !important;
width: 100% !important;
background-color: red;">
</div>
<div class="" style="height: 400px !important;
width: 100% !important;
background-color: blue;">
</div>
</div>
所以有一个 div,它有一定的高度。它里面有两个高度相同的div,这意味着它们的高度加起来是容器div的两倍。溢出是隐藏的,所以只显示第一个 div。
我现在想等待用户悬停,然后设置动画并将第二个 div 向上移动,以便第二个 div 现在隐藏第一个 div。在取消悬停时,我想恢复整个事情。
我该怎么做这样的事情,我在正确的轨道上吗?
【问题讨论】:
-
嗨乔治,你已经尝试过的代码是什么?
标签: javascript jquery html css