File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ const CAROUSEL_SCROLL_DOWN_BUTTON_OFFSET = {X: -5, Y: -25};
33
44$ ( document ) . ready ( ( ) => {
55 let slider = $ ( "#slider" ) ;
6+ if ( slider === null ) return ;
67 if ( slider . length ) {
78 slider . slick ( {
89 dots : true ,
@@ -40,5 +41,15 @@ $(document).ready(() => {
4041
4142 // Position carousel scroll-down button
4243 $ ( window ) . on ( "scroll load resize focus blur" , recalculate_arrow_position ) ;
44+ // Set interval (necessary for ensuring positioning when resize events don't trigger properly)
45+ $ ( window ) . on ( "resize" , ( ) => {
46+ const maxLoops = 10 ;
47+ let loops = 0 ;
48+ let tempInterval = setInterval ( ( ) => {
49+ if ( loops >= maxLoops ) clearInterval ( tempInterval ) ;
50+ recalculate_arrow_position ( ) ;
51+ loops ++ ;
52+ } , 100 ) ;
53+ } ) ;
4354 recalculate_arrow_position ( ) ;
4455} ) ;
You can’t perform that action at this time.
0 commit comments