diff --git a/docs/assets/scss/_component-examples.scss b/docs/assets/scss/_component-examples.scss index dd3cc190c2..91fcc4424b 100644 --- a/docs/assets/scss/_component-examples.scss +++ b/docs/assets/scss/_component-examples.scss @@ -332,6 +332,12 @@ overflow: auto; } +.scrollspy-example-2 { + position: relative; + height: 350px; + overflow: auto; +} + // Helpers .bd-example > { .bg-primary, diff --git a/docs/components/list-group.md b/docs/components/list-group.md index f3b5b7c892..5dbb6db408 100644 --- a/docs/components/list-group.md +++ b/docs/components/list-group.md @@ -167,3 +167,195 @@ Add nearly any HTML within, even for linked list groups like the one below, with {% endexample %} + +## JavaScript behavior + +Use the tab JavaScript plugin—include it individually or through the compiled `bootstrap.js` file—to extend our list group to create tabbable panes of local content. + +
+ +{% highlight html %} + +{% endhighlight %} + +### Using data attributes + +You can activate a list group navigation without writing any JavaScript by simply specifying `data-toggle="list"` or on an element. Use these data attributes on `.list-group-item`. + +Event Type | +Description | +
---|---|
show.bs.tab | +This event fires on tab show, but before the new tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively. |
+
shown.bs.tab | +This event fires on tab show after a tab has been shown. Use event.target and event.relatedTarget to target the active tab and the previous active tab (if available) respectively. |
+
hide.bs.tab | +This event fires when a new tab is to be shown (and thus the previous active tab is to be hidden). Use event.target and event.relatedTarget to target the current active tab and the new soon-to-be-active tab, respectively. |
+
hidden.bs.tab | +This event fires after a new tab is shown (and thus the previous active tab is hidden). Use event.target and event.relatedTarget to target the previous active tab and the new active tab, respectively. |
+