File tree 2 files changed +20
-16
lines changed
2 files changed +20
-16
lines changed Original file line number Diff line number Diff line change 78
78
}
79
79
} ;
80
80
81
- var w ;
82
-
83
81
/**
84
82
* Horizontal accordion
85
83
*
86
84
* @deprecated will be replaced with a more robust implementation
87
- */
88
- $ . tools . tabs . addEffect ( "horizontal" , function ( i , done ) {
85
+ */
89
86
87
+ var w ;
88
+
89
+ $ . tools . tabs . addEffect ( "horizontal" , function ( i , done ) {
90
+
90
91
// store original width of a pane into memory
91
- if ( ! w ) { w = this . getPanes ( ) . eq ( 0 ) . width ( ) ; }
92
+ w || ( w = this . getPanes ( ) . eq ( 0 ) . width ( ) ) ;
92
93
93
94
// set current pane's width to zero
94
- this . getCurrentPane ( ) . animate ( { width : 0 } , function ( ) { $ ( this ) . hide ( ) ; } ) ;
95
-
96
- // grow opened pane to it's original width
97
- this . getPanes ( ) . eq ( i ) . animate ( { width : w } , function ( ) {
98
- $ ( this ) . show ( ) ;
99
- done . call ( ) ;
95
+ this . getCurrentPane ( ) . animate ( { width : 0 } , function ( ) {
96
+ $ ( this ) . hide ( ) ;
100
97
} ) ;
101
98
99
+ // grow opened pane to it's original width
100
+ this . getPanes ( ) . eq ( i ) . animate ( { width : w } , function ( ) {
101
+ $ ( this ) . show ( ) ;
102
+ done . call ( ) ;
103
+ } ) ;
104
+
102
105
} ) ;
103
106
104
107
120
123
// public methods
121
124
$ . extend ( this , {
122
125
click : function ( i , e ) {
123
-
126
+
124
127
var tab = tabs . eq ( i ) ;
125
128
126
129
if ( typeof i == 'string' && i . replace ( "#" , "" ) ) {
149
152
trigger . trigger ( e , [ i ] ) ;
150
153
if ( e . isDefaultPrevented ( ) ) { return ; }
151
154
152
- current = i ;
153
-
154
155
// call the effect
155
156
effects [ conf . effect ] . call ( self , i , function ( ) {
156
157
157
158
// onClick callback
158
159
e . type = "onClick" ;
159
160
trigger . trigger ( e , [ i ] ) ;
161
+ current = i ;
160
162
} ) ;
161
163
162
164
// default behaviour
Original file line number Diff line number Diff line change 1
1
2
- < script src ="../js/jquery-1.4 .2.js "> </ script >
2
+ < script src ="../js/jquery-1.6 .2.js "> </ script >
3
3
< script src ="../../src/tabs/tabs.js "> </ script >
4
4
< link rel ="stylesheet " type ="text/css " href ="css/horizontal.css "/>
5
5
@@ -38,5 +38,7 @@ <h3>Third pane</h3>
38
38
39
39
40
40
< script >
41
- $ ( "#accordion" ) . tabs ( ".pane" , { tabs : '.blok' , effect : 'horizontal' } ) ;
41
+ $ ( function ( ) {
42
+ $ ( "#accordion" ) . tabs ( ".pane" , { tabs : '.blok' , effect : 'horizontal' } ) ;
43
+ } ) ;
42
44
</ script >
You can’t perform that action at this time.
0 commit comments