【发布时间】:2015-08-18 06:07:13
【问题描述】:
我在网站上工作,我必须创建一个带有鼠标悬停效果的表格,只有当您将鼠标放在图片上并且仅在 PDF 图标上时才会产生这种效果。
我现在需要的是当您在单个表格行上使用鼠标时应用此效果。我该怎么做?
HTML:
<td class="thumbnail-item" data-th="PDF"><a href="http://salmenpark-test.nowcommu.myhostpoint.ch/wp-content/uploads/2015/07/QH001_LadenMIETEN_SalmenparkBusiness.pdf" target="_blank"><img src="http://salmenpark-test.nowcommu.myhostpoint.ch/wp-content/uploads/2015/07/pdf.png" alt="PDF" height="24" width="24"> </a>
<div class="tooltip">
<img src="qh_1.png" alt="" width="570" height="403" />
<span class="overlay"></span>
<span class="overlay"></span>
</div></td>
CSS:
.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;
【问题讨论】:
标签: html css html-table mouseevent mouseover