|
@ -286,7 +286,8 @@ $.fn.sticky = function(parameters) { |
|
|
context.offset.left += scrollContext.left; |
|
|
context.offset.left += scrollContext.left; |
|
|
} |
|
|
} |
|
|
module.cache = { |
|
|
module.cache = { |
|
|
fits : ( element.height < scrollContext.height ), |
|
|
|
|
|
|
|
|
fits : (element.height <= scrollContext.height), |
|
|
|
|
|
sameHeight : (element.height == context.height), |
|
|
scrollContext : { |
|
|
scrollContext : { |
|
|
height : scrollContext.height |
|
|
height : scrollContext.height |
|
|
}, |
|
|
}, |
|
@ -467,6 +468,7 @@ $.fn.sticky = function(parameters) { |
|
|
cachedPosition = scroll || $scroll.scrollTop(), |
|
|
cachedPosition = scroll || $scroll.scrollTop(), |
|
|
cache = module.cache, |
|
|
cache = module.cache, |
|
|
fits = cache.fits, |
|
|
fits = cache.fits, |
|
|
|
|
|
sameHeight = cache.sameHeight, |
|
|
element = cache.element, |
|
|
element = cache.element, |
|
|
scrollContext = cache.scrollContext, |
|
|
scrollContext = cache.scrollContext, |
|
|
context = cache.context, |
|
|
context = cache.context, |
|
@ -486,8 +488,7 @@ $.fn.sticky = function(parameters) { |
|
|
doesntFit = !fits, |
|
|
doesntFit = !fits, |
|
|
elementVisible = (element.height !== 0) |
|
|
elementVisible = (element.height !== 0) |
|
|
; |
|
|
; |
|
|
|
|
|
|
|
|
if(elementVisible) { |
|
|
|
|
|
|
|
|
if(elementVisible && !sameHeight) { |
|
|
|
|
|
|
|
|
if( module.is.initialPosition() ) { |
|
|
if( module.is.initialPosition() ) { |
|
|
if(scroll.top >= context.bottom) { |
|
|
if(scroll.top >= context.bottom) { |
|
|