Browse Source

Fixes for sticky/vis

pull/2034/head
jlukic 9 years ago
parent
commit
28e123102b
2 changed files with 7 additions and 3 deletions
  1. 8
      src/definitions/behaviors/visibility.js
  2. 2
      src/definitions/modules/sticky.js

8
src/definitions/behaviors/visibility.js

@ -180,9 +180,11 @@ $.fn.visibility = function(parameters) {
event: {
resize: function() {
module.verbose('Window resized');
requestAnimationFrame(module.refresh);
},
load: function() {
module.verbose('Page finished loading');
requestAnimationFrame(module.refresh);
},
// publishes scrollchange event on one scroll
@ -349,13 +351,13 @@ $.fn.visibility = function(parameters) {
}
},
checkVisibility: function(scrollPosition) {
checkVisibility: function(scroll) {
module.verbose('Checking visibility of element', module.cache.element);
if( module.is.visible() ) {
// save scroll position
module.save.scroll(scrollPosition);
module.save.scroll(scroll);
// update calculations derived from scroll
module.save.calculations();
@ -679,7 +681,7 @@ $.fn.visibility = function(parameters) {
}
},
scroll: function(scrollPosition) {
scrollPosition = scrollPosition || $context.scrollTop();
scrollPosition = scrollPosition + settings.offset || $context.scrollTop() + settings.offset;
module.cache.scroll = scrollPosition;
},
direction: function() {

2
src/definitions/modules/sticky.js

@ -167,9 +167,11 @@ $.fn.sticky = function(parameters) {
event: {
load: function() {
module.verbose('Page contents finished loading');
requestAnimationFrame(module.refresh);
},
resize: function() {
module.verbose('Window resized');
requestAnimationFrame(module.refresh);
},
scroll: function() {

Loading…
Cancel
Save