@@ -99,6 +99,8 @@ jQuery(function($, undefined) {
9999 h : undefined , // height
100100 minW : undefined , // minimum Width
101101 minH : undefined , // minimum height
102+ maxW : undefined , // maximum width
103+ maxH : undefined , // maximum height
102104 wMargin : undefined , // Horizontal margin
103105 hMargin : undefined // Vertical margin
104106 } ,
@@ -183,8 +185,8 @@ jQuery(function($, undefined) {
183185 // Update sizes element to not go outsize the viewport.
184186 // Will call 'size' callback filter
185187 size : function ( ) {
186- var maxHeight = this . getInternal ( ) . fullSize . viewH - this . sizes . hMargin ,
187- maxWidth = this . getInternal ( ) . fullSize . viewW - this . sizes . wMargin ;
188+ var maxHeight = ( typeof this . sizes . maxH !== 'undefined' ) ? this . sizes . maxH : this . getInternal ( ) . fullSize . viewH - this . sizes . hMargin ,
189+ maxWidth = ( typeof this . sizes . maxW !== 'undefined' ) ? this . sizes . maxW : this . getInternal ( ) . fullSize . viewW - this . sizes . wMargin ;
188190 if ( this . sizes . minW && this . sizes . minW > this . sizes . w )
189191 this . sizes . w = this . sizes . minW ;
190192 if ( this . sizes . minH && this . sizes . minH > this . sizes . h )
@@ -944,4 +946,4 @@ function ucfirst(str) {
944946 str += '' ;
945947 var f = str . charAt ( 0 ) . toUpperCase ( ) ;
946948 return f + str . substr ( 1 ) ;
947- }
949+ }
0 commit comments