diff options
| author | XhmikosR <[email protected]> | 2020-11-23 09:45:46 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2020-11-24 08:40:11 +0200 |
| commit | 398ddedac77d38e6f8cb652fdbe6b853ef3cb109 (patch) | |
| tree | 089507eb97da1a88dc207a86b8e3d76364943cdb /site/content/docs/4.5/getting-started/javascript.md | |
| parent | 57e045f0ab22b5d8541b2565c348ffe95f155215 (diff) | |
| download | bootstrap-398ddedac77d38e6f8cb652fdbe6b853ef3cb109.tar.xz bootstrap-398ddedac77d38e6f8cb652fdbe6b853ef3cb109.zip | |
Manually backport #32226
docs: use `event` instead of `e`
Diffstat (limited to 'site/content/docs/4.5/getting-started/javascript.md')
| -rw-r--r-- | site/content/docs/4.5/getting-started/javascript.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/site/content/docs/4.5/getting-started/javascript.md b/site/content/docs/4.5/getting-started/javascript.md index 015ea5fdb..faa01c48d 100644 --- a/site/content/docs/4.5/getting-started/javascript.md +++ b/site/content/docs/4.5/getting-started/javascript.md @@ -48,9 +48,9 @@ Bootstrap provides custom events for most plugins' unique actions. Generally, th All infinitive events provide [`preventDefault()`](https://developer.mozilla.org/en-US/docs/Web/API/Event/preventDefault) functionality. This provides the ability to stop the execution of an action before it starts. Returning false from an event handler will also automatically call `preventDefault()`. ```js -$('#myModal').on('show.bs.modal', function (e) { +$('#myModal').on('show.bs.modal', function (event) { if (!data) { - return e.preventDefault() // stops modal from being shown + return event.preventDefault() // stops modal from being shown } }) ``` @@ -80,7 +80,7 @@ All programmatic API methods are **asynchronous** and return to the caller once In order to execute an action once the transition is complete, you can listen to the corresponding event. ```js -$('#myCollapse').on('shown.bs.collapse', function (e) { +$('#myCollapse').on('shown.bs.collapse', function (event) { // Action to execute once the collapsible area is expanded }) ``` @@ -88,7 +88,7 @@ $('#myCollapse').on('shown.bs.collapse', function (e) { In addition a method call on a **transitioning component will be ignored**. ```js -$('#myCarousel').on('slid.bs.carousel', function (e) { +$('#myCarousel').on('slid.bs.carousel', function (event) { $('#myCarousel').carousel('2') // Will slide to the slide 2 as soon as the transition to slide 1 is finished }) |
