JQuery表鼠标在图像上

时间:2013-12-10 22:16:34

标签: jquery image html-table mouseover

我的cshtml中有id="uiViewsThumbnail"的表格。 让我们说我的桌子由以下内容组成:

  <table id="uiViewsThumbnail">
         <img src="blablabla.png" >
         <img src="heyehey.png">>
  </table>

我希望能够在鼠标悬停时显示图像的名称。 我一直在尝试使用

    $('#uiViewsThumbnail img').click(function () {

    });

但它不起作用。当我在没有img的情况下使用#uiViewsThumbnail时,我可以选择整个表格。但是,我想将鼠标移到特定图像上。

1 个答案:

答案 0 :(得分:0)

您可以使用标题:

<img src="blablabla.png" title="Image title" >

检查您的代码。您现在正在使用表格中的图像。应该像:

一样使用
<table>
  <tr>
   <td><img src="some" /></td>
   <td><img src="some" /></td>
  </tr>
</table>