mirror of
https://github.com/twbs/bootstrap.git
synced 2025-01-18 10:52:19 +01:00
querySelector will only select the first element. Adjust to QuerySelectorAll
This commit is contained in:
parent
2f734af472
commit
285ff5ebf9
@ -532,9 +532,11 @@ If no tab was already active, the `hide.bs.tab` and `hidden.bs.tab` events will
|
|||||||
</table>
|
</table>
|
||||||
|
|
||||||
```js
|
```js
|
||||||
var tabEl = document.querySelector('a[data-bs-toggle="list"]')
|
var tabElms = document.querySelectorAll('a[data-bs-toggle="list"]')
|
||||||
tabEl.addEventListener('shown.bs.tab', function (event) {
|
tabElms.forEach(function(tabElm) {
|
||||||
event.target // newly activated tab
|
tabElm.addEventListener('shown.bs.tab', function (event) {
|
||||||
event.relatedTarget // previous active tab
|
event.target // newly activated tab
|
||||||
})
|
event.relatedTarget // previous active tab
|
||||||
|
})
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
Loading…
x
Reference in New Issue
Block a user