我试图创建一个表,其中有几个链接出现onHover并隐藏onleave。我实现了这两个函数JavaScript onmouseleave和onmouseenter在Firefox和IE9中工作,但不在Chrome中?
<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>
我使用的引导框架。 此代码完美适用于IE9和Firefox
是否使用:关于这里COMPAT http://api.jquery.com/hover/
更多信息任何引导的JavaScript?在这种情况下,jQuery已经是必需的了,当你这样做时,你可以从中受益。 – David
我不太了解jquery。不,我没有使用jQuery。但是,我已经从code.jquery.com导入了jquery文件。 –