1
0
mirror of https://github.com/twbs/bootstrap.git synced 2025-08-23 05:33:02 +02:00

Merge branch 'kasperp-tab-event'

This commit is contained in:
Jacob Thornton
2011-09-29 23:01:06 -07:00
3 changed files with 67 additions and 12 deletions

View File

@@ -357,6 +357,27 @@ $('#my-modal').bind('hidden', function () {
})
&lt;/script&gt;</pre>
</p>
<h3>Events</h3>
<table class="zebra-striped">
<thead>
<tr>
<th style="width: 150px;">Event</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td>change</td>
<td>This event fires on tab change. Use <code>event.target</code> and <code>event.relatedTarget</code> to target the active tab and the previous active tab respectively.</td>
</tr>
</tbody>
</table>
<pre class="prettyprint linenums">
$('#.tabs').bind('change', function (e) {
e.target // activated tab
e.relatedTarget // previous tab
})</pre>
<h3>Demo</h3>
<ul class="tabs" data-tabs="tabs" >
<li class="active"><a href="#home">Home</a></li>