mirror of
https://github.com/tenrok/bootstrap.git
synced 2026-06-14 18:42:30 +03:00
docs: switch to fenced codeblocks (#31806)
This commit is contained in:
@@ -149,12 +149,12 @@ To add accordion-like group management to a collapsible area, add the data attri
|
||||
|
||||
Enable manually with:
|
||||
|
||||
{{< highlight js >}}
|
||||
```js
|
||||
var collapseElementList = [].slice.call(document.querySelectorAll('.collapse'))
|
||||
var collapseList = collapseElementList.map(function (collapseEl) {
|
||||
return new bootstrap.Collapse(collapseEl)
|
||||
})
|
||||
{{< /highlight >}}
|
||||
```
|
||||
|
||||
### Options
|
||||
|
||||
@@ -195,12 +195,12 @@ Activates your content as a collapsible element. Accepts an optional options `ob
|
||||
|
||||
You can create a collapse instance with the constructor, for example:
|
||||
|
||||
{{< highlight js >}}
|
||||
```js
|
||||
var myCollapse = document.getElementById('myCollapse')
|
||||
var bsCollapse = new bootstrap.Collapse(myCollapse, {
|
||||
toggle: false
|
||||
})
|
||||
{{< /highlight >}}
|
||||
```
|
||||
|
||||
<table class="table">
|
||||
<thead>
|
||||
@@ -264,9 +264,9 @@ Bootstrap's collapse class exposes a few events for hooking into collapse functi
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{{< highlight js >}}
|
||||
```js
|
||||
var myCollapsible = document.getElementById('myCollapsible')
|
||||
myCollapsible.addEventListener('hidden.bs.collapse', function () {
|
||||
// do something...
|
||||
})
|
||||
{{< /highlight >}}
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user