We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d7a3849 commit 8bfa048Copy full SHA for 8bfa048
lib/web/mage/sticky.js
@@ -11,7 +11,8 @@ define([
11
12
$.widget('mage.sticky', {
13
options: {
14
- container: ''
+ container: '',
15
+ spacingTop: 0
16
},
17
18
/**
@@ -42,6 +43,12 @@ define([
42
43
if( !isStatic && this.element.is(':visible') ) {
44
offset = $(document).scrollTop() - this.parentOffset;
45
46
+ if (typeof this.options.spacingTop === 'function') {
47
+ offset += this.options.spacingTop();
48
+ } else {
49
+ offset += this.options.spacingTop;
50
+ }
51
+
52
offset = Math.max( 0, Math.min( offset, this.maxOffset) );
53
54
this.element.css( 'top', offset );
0 commit comments