|
@ -172,6 +172,7 @@ $.fn.sticky = function(parameters) { |
|
|
element: { |
|
|
element: { |
|
|
margin : element.margin, |
|
|
margin : element.margin, |
|
|
top : element.offset.top - element.margin.top, |
|
|
top : element.offset.top - element.margin.top, |
|
|
|
|
|
left : element.offset.left, |
|
|
width : element.width, |
|
|
width : element.width, |
|
|
height : element.height, |
|
|
height : element.height, |
|
|
bottom : element.offset.top + element.height |
|
|
bottom : element.offset.top + element.height |
|
@ -247,8 +248,8 @@ $.fn.sticky = function(parameters) { |
|
|
size: function() { |
|
|
size: function() { |
|
|
$module |
|
|
$module |
|
|
.css({ |
|
|
.css({ |
|
|
width: module.cache.element.width, |
|
|
|
|
|
height: module.cache.element.height |
|
|
|
|
|
|
|
|
width : module.cache.element.width, |
|
|
|
|
|
height : module.cache.element.height |
|
|
}) |
|
|
}) |
|
|
; |
|
|
; |
|
|
} |
|
|
} |
|
@ -391,6 +392,7 @@ $.fn.sticky = function(parameters) { |
|
|
bindTop: function() { |
|
|
bindTop: function() { |
|
|
module.debug('Binding element to top of parent container'); |
|
|
module.debug('Binding element to top of parent container'); |
|
|
$module |
|
|
$module |
|
|
|
|
|
.css('left' , '') |
|
|
.removeClass(className.fixed) |
|
|
.removeClass(className.fixed) |
|
|
.removeClass(className.bottom) |
|
|
.removeClass(className.bottom) |
|
|
.addClass(className.bound) |
|
|
.addClass(className.bound) |
|
@ -402,6 +404,7 @@ $.fn.sticky = function(parameters) { |
|
|
bindBottom: function() { |
|
|
bindBottom: function() { |
|
|
module.debug('Binding element to bottom of parent container'); |
|
|
module.debug('Binding element to bottom of parent container'); |
|
|
$module |
|
|
$module |
|
|
|
|
|
.css('left' , '') |
|
|
.removeClass(className.fixed) |
|
|
.removeClass(className.fixed) |
|
|
.removeClass(className.top) |
|
|
.removeClass(className.top) |
|
|
.addClass(className.bound) |
|
|
.addClass(className.bound) |
|
@ -414,6 +417,7 @@ $.fn.sticky = function(parameters) { |
|
|
stickTop: function() { |
|
|
stickTop: function() { |
|
|
module.debug('Fixing element to top of page'); |
|
|
module.debug('Fixing element to top of page'); |
|
|
$module |
|
|
$module |
|
|
|
|
|
.css('left', module.cache.element.left) |
|
|
.removeClass(className.bound) |
|
|
.removeClass(className.bound) |
|
|
.removeClass(className.bottom) |
|
|
.removeClass(className.bottom) |
|
|
.addClass(className.fixed) |
|
|
.addClass(className.fixed) |
|
@ -425,6 +429,7 @@ $.fn.sticky = function(parameters) { |
|
|
stickBottom: function() { |
|
|
stickBottom: function() { |
|
|
module.debug('Sticking element to bottom of page'); |
|
|
module.debug('Sticking element to bottom of page'); |
|
|
$module |
|
|
$module |
|
|
|
|
|
.css('left', module.cache.element.left) |
|
|
.removeClass(className.bound) |
|
|
.removeClass(className.bound) |
|
|
.removeClass(className.top) |
|
|
.removeClass(className.top) |
|
|
.addClass(className.fixed) |
|
|
.addClass(className.fixed) |
|
@ -456,6 +461,10 @@ $.fn.sticky = function(parameters) { |
|
|
module.debug('Reseting elements position'); |
|
|
module.debug('Reseting elements position'); |
|
|
module.unbind(); |
|
|
module.unbind(); |
|
|
module.unfix(); |
|
|
module.unfix(); |
|
|
|
|
|
module.resetCSS(); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
resetCSS: function() { |
|
|
$module |
|
|
$module |
|
|
.css({ |
|
|
.css({ |
|
|
top : '', |
|
|
top : '', |
|
|