File tree Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Expand file tree Collapse file tree 1 file changed +20
-1
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ define([
68
68
this . element . on ( 'dimensionsChanged' , $ . proxy ( this . reset , this ) ) ;
69
69
70
70
this . reset ( ) ;
71
+
72
+ // Application of the workaround for IE11 and Edge
73
+ this . normalizeIE11AndEdgeScroll ( ) ;
71
74
} ,
72
75
73
76
/**
@@ -128,11 +131,27 @@ define([
128
131
} ,
129
132
130
133
/**
131
- * Facade method that palces sticky element where it should be.
134
+ * Facade method that places sticky element where it should be.
132
135
*/
133
136
reset : function ( ) {
134
137
this . _calculateDimens ( )
135
138
. _stick ( ) ;
139
+ } ,
140
+
141
+ /**
142
+ * Workaround for IE11 and Edge that solves the IE known rendering issue
143
+ * that prevents sticky element from jumpy movement on scrolling the page.
144
+ *
145
+ * Alternatively, undesired jumpy movement can be eliminated by changing the setting in IE:
146
+ * Settings > Internet options > Advanced tab > inside 'Browsing' item > set 'Use smooth scrolling' to False
147
+ */
148
+ normalizeIE11AndEdgeScroll : function ( ) {
149
+ if ( navigator . userAgent . match ( / T r i d e n t .* r v [ : ] * 1 1 \. | E d g e \/ / ) ) {
150
+ document . body . addEventListener ( 'mousewheel' , function ( ) {
151
+ event . preventDefault ( ) ;
152
+ window . scrollTo ( 0 , window . pageYOffset - event . wheelDelta ) ;
153
+ } ) ;
154
+ }
136
155
}
137
156
} ) ;
138
157
You can’t perform that action at this time.
0 commit comments