Html 表:如何更改单行鼠标上的图片?
我在一个网站上工作,我必须创建一个带有鼠标悬停效果的表格。 正如您在这里所看到的,只有当您在图片上使用鼠标并且仅在PDF图标上使用鼠标时,才会产生效果 我现在需要的是在单表行上使用鼠标时应用此效果。我怎么做 表: HTML:Html 表:如何更改单行鼠标上的图片?,html,css,html-table,mouseevent,mouseover,Html,Css,Html Table,Mouseevent,Mouseover,我在一个网站上工作,我必须创建一个带有鼠标悬停效果的表格。 正如您在这里所看到的,只有当您在图片上使用鼠标并且仅在PDF图标上使用鼠标时,才会产生效果 我现在需要的是在单表行上使用鼠标时应用此效果。我怎么做 表: HTML: 在Jquery代码中,使用td.hover函数的类并尝试使用以下代码 $(".thumbnail-item").hover(function() { //Write your js code what you have written for hover pdf im
在Jquery代码中,使用td.hover函数的类并尝试使用以下代码
$(".thumbnail-item").hover(function() {
//Write your js code what you have written for hover pdf image
});
如果您也发布jquery代码,我们会更好地理解。Antionio:
CSS:
HTML:
。。。
...
等等等等
您正在将“缩略图项”css引用添加到表示数据单元的
标记中。您希望“缩略图项目”css引用位于整行,因此它应该位于每个
标记上 很好用!有没有向行中添加的选项?--我喜欢David Thomas的答案——基本上,不,在声明
之前,您不能/不应该使用
标记。不过Jscript使用onClick很容易解决这个问题。
.thumbnail-item {
/* position relative so that we can use position absolute for the tooltip */
display: inherit;
height: 10px;
max-width: 5px;
}
.thumbnail-item a {
display: block;
}
.tooltip {
/* by default, hide it */
display: none;
/* allow us to move the tooltip */
position: absolute;
/* align the image properly */
padding: 8px 0 0 8px;
z-index: 500;
top: 7px;
left: -8px !important;
max-width: 570px !important;
max-height: 403px !important;
$(".thumbnail-item").hover(function() {
//Write your js code what you have written for hover pdf image
});
.thumbnail-item {
/* delete the line that was here for inheriting the display * /
height: 10px;
max-width: 5px;
}
<tr class="thumbnail-item white">...</tr>
<tr class="thumbnail-item grey">...</tr>