最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - jsf decorate dataTable row on mouse overout - Stack Overflow

programmeradmin7浏览0评论

In plain html, when I want to point-out a table row, I just write:

<tr onmouseover="javaScript_(jQuery)_Code_To_Add_Pointed_Out_Class"
    onmouseout="javaScript_(jQuery)_Code_To_Remove_Pointed_Out_Class">
...
</tr>

Is there a way to do this in a <h:dataTable> for JSF? Something with Primefaces or what else?

In plain html, when I want to point-out a table row, I just write:

<tr onmouseover="javaScript_(jQuery)_Code_To_Add_Pointed_Out_Class"
    onmouseout="javaScript_(jQuery)_Code_To_Remove_Pointed_Out_Class">
...
</tr>

Is there a way to do this in a <h:dataTable> for JSF? Something with Primefaces or what else?

Share Improve this question edited Sep 3, 2011 at 22:06 Martijn Courteaux 68.9k47 gold badges201 silver badges295 bronze badges asked Sep 3, 2011 at 21:53 Marco VasapolloMarco Vasapollo 5196 silver badges17 bronze badges 1
  • Maybe a duplicate of this question: stackoverflow./questions/5055384/… – Robin Commented Sep 3, 2011 at 22:02
Add a ment  | 

1 Answer 1

Reset to default 8

Styling is to be done by CSS. E.g.

<h:dataTable styleClass="myTableClass">
    ...
</h:dataTable>

with

.myTableClass>tbody>tr { 
    background: pink;
}

.myTableClass>tbody>tr:hover { 
    background: purple; 
}

JavaScript hacks like in your question example are only necessary for ancient browsers which are already deprecated for long now.

发布评论

评论列表(0)

  1. 暂无评论