table row
マウスを上に置いたときに、それぞれに配置されたdivを表示したかったのです。ホバーされたdiv.tools
のはtable row
、ホバーアウト時に表示および非表示になります。
これが私のテーブルです。
<table width="99%" cellspacing="0" cellpadding="2" class="main-box">
<tbody><tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent">Categories / Products</td>
<td class="dataTableHeadingContent" align="right">Action </td>
</tr>
<tr id="product_37">
<td class="dataTableContent">
<a href="#">Cotton Piqué Tennis Shirt</a>
<div class="tools" style="display:none;">Tools Here</div>
</td>
<td class="dataTableContent" align="right">
<img src="#/images/icon_arrow_right.gif" border="0" alt="">
</td>
</tr>
<tr id="product_39">
<td class="dataTableContent">
<a href="#">Leather Plus Cotton Cut-Out Sling Back Sandal</a>
<div class="tools" style="display:none;">Tools Here</div>
</td>
<td class="dataTableContent" align="right">
<a href="#"><img src="#/images/icon_info.gif" border="0" alt="Info" title=" Info "></a>
</td>
</tr>
<tr id="product_38">
<td class="dataTableContent">
<a href="#">Poly-Cotton 3/4 Sleeve Raglan Shirt</a>
<div class="tools" style="display:none;">Tools Here</div>
</td>
<td class="dataTableContent" align="right">
<a href="#">
<img src="#/images/icon_info.gif" border="0" alt="Info" title=" Info "></a>
</td>
</tr>
</tbody>
</table>
このjQuery関数を試しましたが、機能しません。
jQuery(function() {
jQuery('*[id^=product_]').hover(function(){
jQuery(this).children("div.tools").show();
},function(){
jQuery(this).children("div.tools").hide();
});
});
});