From e16de59260c860af67748a484631ae3de56fc244 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Kasper=20B=C3=B8gebjerg=20Pedersen?=
Date: Sun, 18 Sep 2011 10:15:24 +0200
Subject: Added changed event to bootstrap-tabs.js
---
docs/javascript.html | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
(limited to 'docs/javascript.html')
diff --git a/docs/javascript.html b/docs/javascript.html
index f8ef930c6..2495e491d 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -357,6 +357,26 @@ $('#my-modal').bind('hidden', function () {
})
</script>
+ Events
+
+
+
+ | Event |
+ Description |
+
+
+
+
+ | changed |
+ This event fires when the tabs are changed. The event provides an additional parameter which holds id of the previous tab and the id of the new current tab. This information is stored in an object with two properties called from and to, e.g. {to: '#home', from: '#profile'}. This event allows you load and change content of the tabs on request. |
+
+
+
+
+
+$('#.tabs').bind('changed', function (e, c) {
+ // do something with c.from and c.to ...
+})
Demo
- Home
--
cgit v1.2.3
From b827303511d68fdb3f913aef63f97b5f77725d68 Mon Sep 17 00:00:00 2001
From: Jacob Thornton
Date: Thu, 29 Sep 2011 22:21:55 -0700
Subject: changed event should be change event
---
docs/javascript.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
(limited to 'docs/javascript.html')
diff --git a/docs/javascript.html b/docs/javascript.html
index b1816229e..1f5ad1a38 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -367,8 +367,8 @@ $('#my-modal').bind('hidden', function () {
- | changed |
- This event fires when the tabs are changed. The event provides an additional parameter which holds id of the previous tab and the id of the new current tab. This information is stored in an object with two properties called from and to, e.g. {to: '#home', from: '#profile'}. This event allows you load and change content of the tabs on request. |
+ change |
+ This event fires on tab change. The event provides an additional parameter which holds the id of the previous tab and the id of the new current tab. This information is stored in an object with two properties called from and to, e.g. { to: '#home', from: '#profile' }. |
--
cgit v1.2.3
From a0bf8b67ff4dd827f9298563616ecc519e7924c8 Mon Sep 17 00:00:00 2001
From: Jacob Thornton
Date: Thu, 29 Sep 2011 23:00:10 -0700
Subject: change event to use target and relatedTarget (which more closely
resembles actual event api)
---
docs/javascript.html | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
(limited to 'docs/javascript.html')
diff --git a/docs/javascript.html b/docs/javascript.html
index 1f5ad1a38..956dfd0a8 100644
--- a/docs/javascript.html
+++ b/docs/javascript.html
@@ -368,14 +368,15 @@ $('#my-modal').bind('hidden', function () {
| change |
- This event fires on tab change. The event provides an additional parameter which holds the id of the previous tab and the id of the new current tab. This information is stored in an object with two properties called from and to, e.g. { to: '#home', from: '#profile' }. |
+ This event fires on tab change. Use event.target and event.relatedTarget to target the active tab and the previous active tab respectively. |
-$('#.tabs').bind('changed', function (e, c) {
- // do something with c.from and c.to ...
+$('#.tabs').bind('change', function (e) {
+ e.target // activated tab
+ e.relatedTarget // previous tab
})
Demo