我試圖創建一個表,其中有幾個鏈接出現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文件。 –