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: [PATCH] Added changed event to bootstrap-tabs.js --- docs/javascript.html | 20 +++++++++++++++++ js/bootstrap-tabs.js | 4 +++- js/tests/unit/bootstrap-tabs.js | 38 ++++++++++++++++++++++++++------- 3 files changed, 53 insertions(+), 9 deletions(-) diff --git a/docs/javascript.html b/docs/javascript.html index f8ef930c6e..2495e491db 100644 --- a/docs/javascript.html +++ b/docs/javascript.html @@ -357,6 +357,26 @@ $('#my-modal').bind('hidden', function () { }) </script>

+

Events

+ + + + + + + + + + + + + +
EventDescription
changedThis 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