@@ -56,7 +56,7 @@ $.effects.scale = function(o) {
5656 var direction = o . options . direction || 'both' ; // Set default axis
5757 var origin = o . options . origin ; // The origin of the scaling
5858 if ( mode != 'effect' ) { // Set default origin and restore for show/hide
59- origin = origin || [ 'middle' , 'center' ] ;
59+ options . origin = origin || [ 'middle' , 'center' ] ;
6060 options . restore = true ;
6161 }
6262 var original = { height : el . height ( ) , width : el . width ( ) } ; // Save original
@@ -68,13 +68,7 @@ $.effects.scale = function(o) {
6868 x : direction != 'vertical' ? ( percent / 100 ) : 1
6969 } ;
7070 el . to = { height : original . height * factor . y , width : original . width * factor . x } ; // Set to state
71- if ( origin ) { // Calculate baseline shifts
72- var baseline = $ . effects . getBaseline ( origin , original ) ;
73- el . from . top = ( original . height - el . from . height ) * baseline . y ;
74- el . from . left = ( original . width - el . from . width ) * baseline . x ;
75- el . to . top = ( original . height - el . to . height ) * baseline . y ;
76- el . to . left = ( original . width - el . to . width ) * baseline . x ;
77- } ;
71+
7872 if ( o . options . fade ) { // Fade option to support puff
7973 if ( mode == 'show' ) { el . from . opacity = 0 ; el . to . opacity = 1 ; } ;
8074 if ( mode == 'hide' ) { el . from . opacity = 1 ; el . to . opacity = 0 ; } ;
@@ -106,11 +100,18 @@ $.effects.size = function(o) {
106100 var mode = $ . effects . setMode ( el , o . options . mode || 'effect' ) ; // Set Mode
107101 var restore = o . options . restore || false ; // Default restore
108102 var scale = o . options . scale || 'both' ; // Default scale mode
103+ var origin = o . options . origin ; // The origin of the sizing
109104 var original = { height : el . height ( ) , width : el . width ( ) } ; // Save original
110105 el . from = o . options . from || original ; // Default from state
111106 el . to = o . options . to || original ; // Default to state
112-
113107 // Adjust
108+ if ( origin ) { // Calculate baseline shifts
109+ var baseline = $ . effects . getBaseline ( origin , original ) ;
110+ el . from . top = ( original . height - el . from . height ) * baseline . y ;
111+ el . from . left = ( original . width - el . from . width ) * baseline . x ;
112+ el . to . top = ( original . height - el . to . height ) * baseline . y ;
113+ el . to . left = ( original . width - el . to . width ) * baseline . x ;
114+ } ;
114115 var factor = { // Set scaling factor
115116 from : { y : el . from . height / original . height , x : el . from . width / original . width } ,
116117 to : { y : el . to . height / original . height , x : el . to . width / original . width }
0 commit comments