File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 17
17
parentSelector : null , // a selector representing the parent to vertically center this element within
18
18
debounceTimeout : 25 // a default debounce timeout in milliseconds
19
19
} , options || { } ) ;
20
- var debounce ;
21
20
22
21
return this . each ( function ( ) {
23
22
var $this = $ ( this ) ; // store the object
23
+ var debounce ;
24
24
25
25
// recalculate the distance to the top of the element to keep it centered
26
26
var resizer = function ( ) {
27
27
28
- var parentHeight = ( settings . parentSelector ) ? $this . parents ( settings . parentSelector ) . first ( ) . height ( ) : $this . parent ( ) . height ( ) ;
28
+ var parentHeight = ( settings . parentSelector && $this . parents ( settings . parentSelector ) . length ) ?
29
+ $this . parents ( settings . parentSelector ) . first ( ) . height ( ) : $this . parent ( ) . height ( ) ;
29
30
30
31
$this . css (
31
32
settings . cssAttribute , ( ( ( parentHeight - $this . height ( ) ) / 2 ) + parseInt ( settings . verticalOffset ) )
You can’t perform that action at this time.
0 commit comments