引导程序中的缩略图标题悬停效果
Thumbnail Caption hover effect in bootstrap
我想在缩略图中有字幕悬停效果,为此我做了这样的编码
$(document).ready (function() {
$ ('.thumbnail').hover(
function( ) {
$ (this).find ('.caption').slideDown(250); //.fadeIn(250)
},
function( ) {
$ (this).find ('.caption').slideUp(250); //.fadeOut(205)
}
);
});
.thumbnail {
position:relative;
overflow:hidden;
}
.caption {
position:absolute;
top:0;
right:0;
background:RGB( 5, 5, 5) ;
color:#FFFFFF;
text-align:center;
z-index:2;
width:100%;
height:100%;
padding:2%;
display:none;
}
<div class="col-sm-4">
<div class="thumbnail">
<img src="two.jpg" alt="two" class="align-center img-responsive">
<div class="caption">
<h3>Women's Clothing</h3>
<p>Shop Now !</p>
<p><a href="" class="label label-danger" title="Shop Now"></a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="thumbnail">
<img src="three.jpg" alt="three" class="align-center img-responsive">
<div class="caption">
<h3> Juniors Clothing</h3>
<p>Shop Now !</p>
</div>
</div>
</div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div class="row">
<div class="col-sm-4">
<div class="thumbnail">
<div class="caption">
<h3>Men's Clothing</h3>
<p>Shop Now !</p>
</div>
<img src="one.jpg" alt="one">
</div>
</div>
<div class="col-sm-4">
<div class="thumbnail">
<img src="two.jpg" alt="two" class="align-center img-responsive">
<div class="caption">
<h3>Women's Clothing</h3>
<p>Shop Now !</p>
<p><a href="" class="label label-danger" title="Shop Now"></a>
</div>
</div>
</div>
<div class="col-sm-4">
<div class="thumbnail">
<img src="three.jpg" alt="three" class="align-center img-responsive">
<div class="caption">
<h3> Juniors Clothing</h3>
<p>Shop Now !</p>
</div>
</div>
</div>
</div>
在图像上,当我拿鼠标时,它只显示文本,但拇指钉。上下滑动的悬停功能不显示。
任何人都知道,根据编码,我做错了什么。
这是CSS的问题。见下文:
.caption {
position:absolute;
top:0;
left:0;
background-color:rgba(255, 255, 255, 0.58);
color:#FFFFFF;
text-align:center;
z-index:2;
width:180px;
height:90px;
padding:10px;
display:none;
}
http://jsfiddle.net/a7m2ce7u/1/
相关文章:
- 链接悬停css在不浮动时不在表浮动标题中工作
- 当我悬停使用php连接到mysql的图像时显示标题
- 粘性标题徽标悬停
- 将鼠标悬停在图像上,图像的不透明度和图像下方标题的颜色会发生变化..同样,当标题变成两行时,它会破坏格式
- 引导程序中的缩略图标题悬停效果
- 悬停图像时是否可以隐藏标题
- 如何在鼠标悬停时动态向标题添加文本
- 悬停标题更改不透明度图像时
- Jquery 悬停并显示完整标题
- 将鼠标悬停在图像上时删除图像标题
- 选择列表标题未显示在鼠标悬停时
- 当鼠标悬停在TD上时,保持标题向上,并将其隐藏在鼠标上
- D3.js将鼠标悬停在栏上时更改标题文本
- 单击时显示范围标题,就像鼠标悬停时一样
- 如何在没有 CSS 的情况下将鼠标悬停在标题上时使缩略图消失
- 使标题属性在悬停时立即显示
- 当鼠标悬停在表格标题上时,工具提示宽度将被隐藏
- JQuery在图像悬停显示标题标签内容,可能的
- 使用clipboard.js更新悬停时的标题属性
- 如何显示鼠标悬停标题单元格的工具提示?