diff options
| author | Johann-S <[email protected]> | 2019-05-14 11:46:25 +0200 |
|---|---|---|
| committer | Johann-S <[email protected]> | 2019-05-14 14:32:45 +0200 |
| commit | fd8a651521f9b9ad5a58e0bd6969fe57777c0812 (patch) | |
| tree | 832d4e6879a5d5f6106a24a42dfc5ccd74035f4c | |
| parent | 99b2a80db844967c9f4b39bfd12dfd1c1c86b041 (diff) | |
| download | bootstrap-fd8a651521f9b9ad5a58e0bd6969fe57777c0812.tar.xz bootstrap-fd8a651521f9b9ad5a58e0bd6969fe57777c0812.zip | |
remove some jquery references in collapse docs
| -rw-r--r-- | site/content/docs/4.3/components/collapse.md | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/site/content/docs/4.3/components/collapse.md b/site/content/docs/4.3/components/collapse.md index 7bdc296b9..1197f0afc 100644 --- a/site/content/docs/4.3/components/collapse.md +++ b/site/content/docs/4.3/components/collapse.md @@ -150,7 +150,10 @@ To add accordion-like group management to a collapsible area, add the data attri Enable manually with: {{< highlight js >}} -$('.collapse').collapse() +var collapseElementList = [].slice.call(document.querySelectorAll('.collapse')) +var collapseList = collapseElementList.map(function (collapseEl) { + return new bootstrap.Collapse(collapseEl) +}) {{< /highlight >}} ### Options @@ -205,6 +208,7 @@ var bsCollapse = new bootstrap.Collapse(myCollapse, { | `show` | Shows a collapsible element. **Returns to the caller before the collapsible element has actually been shown** (i.e. before the `shown.bs.collapse` event occurs).| | `hide` | Hides a collapsible element. **Returns to the caller before the collapsible element has actually been hidden** (i.e. before the `hidden.bs.collapse` event occurs).| | `dispose` | Destroys an element's collapse. | +| `_getInstance` | *Static* method which allows you to get the collapse instance associated with a DOM element | ### Events @@ -238,7 +242,8 @@ Bootstrap's collapse class exposes a few events for hooking into collapse functi </table> {{< highlight js >}} -$('#myCollapsible').on('hidden.bs.collapse', function () { +var myCollapsible = document.getElementById('myCollapsible') +myCollapsible.addEventListener('hidden.bs.collapse', function () { // do something... }) {{< /highlight >}} |
