悬停时放大图像,但不要'不要把容器放大
Enlarge Image when hover but don't make the container enlarged
当图像悬停时,我正试图找到一种不放大表格的方法。这是我的密码。感谢
<script language="javascript" type="text/javascript">
//opacity: 0.5,
$(document).ready(function () {
$("#thServer img").hover(function () {
$(this).stop().animate({ width: 70, height: 70 }, 100);
}, function () {
$(this).stop().animate({ width: 50, height: 50 }, 100);
});
});
</script>
<table style="border-style: solid">
<tr>
<th id="thServer">
<img src="NewVersion.png" width="50" height="50"></img>
</th>
</tr>
<tr>
<td>
</td>
</tr>
</table>
试试这个css片段:
#thServer {
width: 50px;
height: 50px;
position: relative;
}
#thServer img {
position: absolute;
top: 0;
left: 0;
margin: 0;
}
实现这个很容易
table {
height: 50px;
**table-layout: fixed;**
width: 250px;} th {
**overflow: hidden;**
white-space: nowrap;}
然后通过jquery 使图像位置:绝对
<th id="thServer">
<img src="NewVersion.png" **style="position:absolute;"** width="50" height="50"></img>
</th>
然后添加更多带有左值和上值的样式,以将图像定位在正确的位置。
相关文章:
- 鼠标悬停时如何居中放大背景图像
- jQuery"悬停时放大”;无法相对于图片中心放大
- 悬停时放大图像,但不要'不要把容器放大
- 鼠标悬停在单个文本字母上的放大效果
- 使用 JavaScript 在鼠标悬停时在内容顶部查看放大的图像
- 获取较小的图像,以便在悬停和放大时以完整质量加载
- 如何在不悬停/单击的情况下设置放大图像的动画
- 使用jQuery&/或CSS,以在悬停时放大图像并保持选中状态
- 使用snap.svg IE和EDGE网络浏览器快速悬停,放大/缩小动画
- 使用snap.svg在悬停时放大/缩小animate
- Javascript:在没有Jquery或插件的情况下放大鼠标悬停
- 用JQuery放大悬停图像的问题
- 在悬停时放大并调整大小为原始大小
- 放大图像悬停使用Twitter引导
- 当我将鼠标悬停在矢量的一部分上时,如何放大图像?
- 如何使用jQuery临时放大悬停字体大小
- 悬停背景(放大),前面的文字没有放大
- 我如何逐渐放大,而改变鼠标悬停的颜色和逐渐缩小和褪色的颜色上的鼠标房子
- 如何在使用JS悬停时放大纯CSS菜单项
- 悬停时放大图像并在其上显示文本CSS3