admin管理员组文章数量:1302869
In DataTables examples, I see that the mouse cursor changes to indicate a link when hovering above sortable column headers. However, I do not get the same effect in my own project. I configure DataTables like so (with theming by jQuery UI ThemeRoller):
$('#build-table').dataTable({
'aaSorting': [[1, 'desc'], [0, 'asc'], [2, 'asc']],
'bJQueryUI': true,
});
How do I get the mouse cursor behaviour, when hovering above sortable column headers, of the DataTables demos?
EDIT
I know it's doable with CSS, but wondering if there's anything out of the box as the DataTable demos all work like this.
In DataTables examples, I see that the mouse cursor changes to indicate a link when hovering above sortable column headers. However, I do not get the same effect in my own project. I configure DataTables like so (with theming by jQuery UI ThemeRoller):
$('#build-table').dataTable({
'aaSorting': [[1, 'desc'], [0, 'asc'], [2, 'asc']],
'bJQueryUI': true,
});
How do I get the mouse cursor behaviour, when hovering above sortable column headers, of the DataTables demos?
EDIT
I know it's doable with CSS, but wondering if there's anything out of the box as the DataTable demos all work like this.
Share Improve this question edited Aug 26, 2011 at 14:07 aknuds1 asked Aug 26, 2011 at 13:58 aknuds1aknuds1 68.1k69 gold badges206 silver badges320 bronze badges 1- Using CSS, for example: cursor: pointer; – Prisoner ZERO Commented Aug 26, 2011 at 14:03
3 Answers
Reset to default 4I'm not familiar with dataTable()
specifically, but the easiest way is to give the sortable columns a class and use the CSS cursor:pointer;
property to make the mouse indicate it is clickable.
The datatables demos all use demo_table.css and this rule:
table.display thead th {
padding: 3px 18px 3px 10px;
border-bottom: 1px solid black;
font-weight: bold;
cursor: pointer; /*This is what you want*/
* cursor: hand;
}
Add following as CSS and you are good to go.
.sorting {
cursor:pointer;
}
.sorting_asc {
cursor:pointer;
}
.sorting_desc {
cursor:pointer;
}
本文标签:
版权声明:本文标题:javascript - With jQuery DataTables, how do I make the mouse cursor change over sortable column headers? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741690382a2392686.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论