Skip to content

Commit

Permalink
Updated Spacer to include pin element margin.
Browse files Browse the repository at this point in the history
  • Loading branch information
janpaepke committed Nov 19, 2013
1 parent d64eba6 commit 3ecd5aa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions js/jquery.superscrollorama.js
Expand Up @@ -211,19 +211,19 @@
// If we want to push down following Items we need a spacer to do it, while and after our element is fixed.
if (pinObj.pushFollowers) {
if (superscrollorama.settings.isVertical) {
pinObj.spacer.height(pinObj.dur + el.outerHeight());
pinObj.spacer.height(pinObj.dur + el.outerHeight(true));
} else {
pinObj.spacer.width(pinObj.dur + el.outerWidth());
pinObj.spacer.width(pinObj.dur + el.outerWidth(true));
}
} else {
if (pinObj.origPositioning.pos === "absolute") { // no spacer
pinObj.spacer.width(0);
pinObj.spacer.height(0);
} else { // spacer needs to reserve the elements space, while pinned
if (superscrollorama.settings.isVertical) {
pinObj.spacer.height(el.outerHeight());
pinObj.spacer.height(el.outerHeight(true));
} else {
pinObj.spacer.width(el.outerWidth());
pinObj.spacer.width(el.outerWidth(true));
}
}
}
Expand Down Expand Up @@ -467,4 +467,4 @@
return superscrollorama;
};

})(jQuery);
})(jQuery);

0 comments on commit 3ecd5aa

Please sign in to comment.