我在html中有一个表,它显示来自mysql的数据。
<table>
<thead>
<tr>
<th>Header-1</th>
<th>Header-2</th>
</tr>
</thead>
<?php foreach($results as $key=>$row) { ?>
<tr>
<td><?php echo $row['Data-1'];?></td>
<td><?php echo $row['Data-2'];?></td>
</tr>
</table>数据-1和数据-2中的字符数更多,所以我想限制最多3-4行,但是当光标放在它们上时,我想要一个弹出窗口来显示弹出的全部数据,window.How,这能做到吗?
提前谢谢..。
发布于 2016-02-24 03:42:25
我会用overflow:hidden; CSS属性使每一段数据固定长度,然后调整我前几天所做的JSFiddle,以便当它们鼠标经过时,整个单元格会扩展,或者弹出显示的是完整的数据:https://jsfiddle.net/07q6pLfj/1/。
<div>
<p>This is an element which does not change when you hover over it.</p>
<div class="hover"><div class="popup">
This is text which pops up when you hover
</div>
When you hover over this a popup shows.
</div>
$(".hover").mouseover(function() {
$(this).children(".popup").show();
}).mouseout(function() {
$(this).children(".popup").hide();
});
.popup {
display:none;
position:absolute;
background-color: red;
width:400px;
height:400px;
margin-top: 30px;
}https://stackoverflow.com/questions/35592717
复制相似问题