我正在尝试突出显示表格行。即使有了这个针对 z-indexes 等github 问题链接的 bootstrap-tour 修复
看看这个小提琴:jsFiddle
JAVASCRIPT
$("#dialog").dialog();
var t = new Tour({
backdrop: true,
onShown: function(tour) {
var stepElement = getTourElement(tour);
$(stepElement).after($('.tour-step-background'));
$(stepElement).after($('.tour-backdrop'));
},
steps: [
{
element: "table tbody tr:first-of-type",
title: "Title",
placement: 'bottom',
content: "Content"
}
]
}).restart();
function getTourElement(tour){
return tour._options.steps[tour._current].element
}
HTML
<table>
<thead>
<tr>
<th>Name</th>
<th>Power</th>
<th>Health</th>
</tr>
</thead>
<tbody>
<tr>
<td>Superman</td>
<td>Flying</td>
<td>100%</td>
</tr>
<tr>
<td>Superman</td>
<td>Flying</td>
<td>100%</td>
</tr>
<tr>
<td>Superman</td>
<td>Flying</td>
<td>100%</td>
</tr>
</tbody>
</table>
CSS
table{
width:100%;
}
.tour-step-background,
.tour-backdrop {
position: fixed;
}
.tour-step-background {
background: #fff;
}
如您所见,仅当您将其 css 更改为时,它才会显示(表格行“tr”):display:block;
但是它会失去它的风格。