You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+19-5Lines changed: 19 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,7 +94,10 @@ Below you will find a list of the available settings for the plugin.
94
94
inAnimation:'show',
95
95
outAnimation:'hide',
96
96
speed:200,
97
-
activeClass:'tab-active'
97
+
activeClass:'tab-active',
98
+
complete:function(element, tab) {
99
+
// code to run on tab click complete
100
+
}
98
101
}
99
102
```
100
103
@@ -122,6 +125,15 @@ The class to add to the currently active tab link. This should not contain a `.`
122
125
123
126
This could be set to `active`, `current-tab`, or any other class of your choice.
124
127
128
+
### complete ###
129
+
130
+
The callback function to run just after a tab link has been clicked and the tab loaded. This should always be a function, and the function can accept the paramaters
131
+
of `element` and `tab`.
132
+
133
+
The `element` is the link element that was clicked on.
134
+
135
+
The `tab` is the tab element that has been shown.
136
+
125
137
Setting Example
126
138
---------------
127
139
@@ -167,7 +179,11 @@ even a data attribute, such as data-tabs.
167
179
inAnimation:'fadeIn',
168
180
outAnimation:'fadeOut',
169
181
speed:250,
170
-
activeClass:'current-tab'
182
+
activeClass:'current-tab',
183
+
complete:function(element, tab) {
184
+
console.log(element); // Would output the jQuery element for the data-tab clicked.
185
+
console.log(tab); // Would output the jQuery element for the data-tab-content shown.
186
+
}
171
187
});
172
188
});
173
189
</script>
@@ -180,7 +196,5 @@ Future Additions
180
196
----------------
181
197
182
198
-~~Addd `active` or `tab-active` class to currently open tab link and tab.~~
183
-
- Add oncomplete callback option.
184
-
- Add `on` option to set what to open the tab on. (eg, click, mouseover, custom event ect.)
199
+
-~~Add oncomplete callback option.~~
185
200
-~~Add `minified` version of `tabs.js`~~
186
-
- Add `on` delay time. (eg, delay for 200ms before loading new tab on hover.)
0 commit comments