我试图创建一个表格,其中有几个链接出现在悬停上并再次隐藏在离开上。我实现了这两个功能
<script type="text/javascript">
function hide(cls, no) {
var select = '.' + cls + no;
$(select).hide();
}
function show(cls, no) {
var select = '.' + cls + no;
$(select).show();
}
</script>
我的 HTML 代码是
<tr onmouseenter="show('inv', 1)" onmouseleave="hide('inv', 1)" >
<td width="30%">
<a class="single_image" href="img/img1-big.png"><span class="icon-picture"></span> Image1.jpg</a>
</td>
<td width="40%" align="center">
<div class="button-col">
<a href="#" class="inline-buttons inv1"><span class="icon-pencil"></span> Rename </a>
<a href="#" class="inline-buttons inv1"><span class="icon-arrow-down"></span> Download </a>
<a href="#" class="inline-buttons inv1"><span class="icon-share"></span> Share </a>
<a href="#" class="inline-buttons inv1"><span class="icon-trash"></span> Delete </a>
</div>
</td>
</tr>
我正在使用 Bootstrap 框架。此代码在 IE9 和 Firefox 上完美运行