【发布时间】:2015-10-22 04:47:39
【问题描述】:
我正在使用带有可点击行的 Twitter Bootstrap 表,这些行在悬停时会突出显示(如果它更容易,我可以摆脱悬停功能)。我希望选定的行保持突出显示,直到单击另一行或重新单击它。
$( document ).ready(function() {
$('#myTable').on('click', 'tbody tr', function(event) {
// console.log("test ");
});
还有桌子
<table class="table table-bordered table-hover" id="myTable">
<tbody>
<tr>
<tr class='clickable-row'>
我在 JS 中试过这段代码,但没有用
$(this).addClass('highlight').siblings().removeClass('highlight');
【问题讨论】:
标签: jquery css twitter-bootstrap twitter-bootstrap-3