File tree Expand file tree Collapse file tree 3 files changed +25
-2
lines changed
Expand file tree Collapse file tree 3 files changed +25
-2
lines changed Original file line number Diff line number Diff line change 3535</div >
3636```
3737
38+ Events
39+ ------
40+
41+ ``` javascript
42+ ' tabs.opened' // passes next tab navigational element and content
43+ ' tabs.animated' // passes .animated-tabs
44+ ```
45+
3846Installation
3947------------
4048
Original file line number Diff line number Diff line change 11{
22 "name" : " tabs" ,
33 "main" : " tabs.js" ,
4- "version" : " 1.0 .0" ,
4+ "version" : " 1.1 .0" ,
55 "homepage" : " https://github.com/markusfalk/tabs" ,
66 "authors" : [
77 " Markus Falk <mail@markus-falk.com>"
Original file line number Diff line number Diff line change @@ -59,6 +59,11 @@ define(['jquery'], function() {
5959 Tabs . start_animation ( ) ;
6060 // });
6161
62+ // events
63+ this . $tab_element . each ( function ( ) {
64+ $ ( this ) . trigger ( 'tabs.initialized' ) ;
65+ } ) ;
66+
6267 } ,
6368 bindEvents : function ( ) {
6469
@@ -181,6 +186,9 @@ define(['jquery'], function() {
181186 // Inhalte animieren/einblenden
182187 Tabs . animate_content ( $target_tab ) ;
183188
189+ // events
190+ $target_tab . trigger ( 'tabs.opened' , [ $target_tab_nav , $target_tab ] ) ;
191+
184192 } ) ;
185193
186194 } ,
@@ -189,14 +197,21 @@ define(['jquery'], function() {
189197 // initialen aufruf durch .animated-tabs verhindern
190198 if ( Tabs . skip_anim > 0 ) {
191199 Tabs . $animatedTabs . each ( function ( ) {
192- Tabs . nextTab ( $ ( this ) ) ;
200+ var that = $ ( this ) ;
201+
202+ Tabs . nextTab ( that ) ;
203+
204+ that . trigger ( 'tabs.animated' , that ) ;
205+
193206 } ) ;
194207 }
195208
196209 // timeout erstellen und skip erhöhen damit if ausgeführt wird
197210 Tabs . animation = setTimeout ( Tabs . start_animation , Tabs . autoplay_speed ) ;
198211 Tabs . skip_anim = Tabs . skip_anim + 1 ;
199212
213+
214+
200215 } ,
201216 stop_animation : function ( ) {
202217 clearTimeout ( Tabs . animation ) ;
You can’t perform that action at this time.
0 commit comments