Jay*_*Jay 5 jquery html5 css3 css-transitions
我想知道是否有人可以帮助我.我想创建一个on click和hover效果,将div作为一种叠加层显示在另一个div上.我最好喜欢使用css3过渡,但如果我必须使用jquery,我会这样做.
我在网上找到了一些东西,比如http://jsfiddle.net/UezUj/1/但是这更像是一个幻灯片切换效果而且走错了路.我想创建类似http://www.ashtonsmith.co.uk/的东西(如果你将鼠标悬停在分销和物流上),但标题会向上滑动以显示内容.
<div class="col-md-4 box__industries">
<div>
<div class="image fill">
<img src="http://lorempixel.com/g/400/200/" width="363" height="159">
</div>
<div class="content">
<h5>Title</h5>
This is my content
</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
我希望div .content在点击和悬停时向上滑动图像.
提前致谢.
请尝试以下代码:
.box_industries
{
background: green;
overflow: hidden;
text-align: center;
position: relative;
}
.box_industries .content
{
background: rgba( 0, 0, 0, 0.9 );
bottom: -100%;
color: #fff;
height: 100%;
left: 0%;
text-align: center;
position: absolute;
transition: bottom 0.5s ease;
width: 100%;
}
.box_industries:hover .content
{
bottom: 0%;
}Run Code Online (Sandbox Code Playgroud)
<div class="col-md-4 box_industries">
<div>
<div class="image fill">
<img src="http://lorempixel.com/g/400/200/" width="363" height="159">
</div>
<div class="content">
<h5>Title</h5>
This is my content
</div>
</div>
</div> Run Code Online (Sandbox Code Playgroud)