Compact layout jumps to top when window resized (mobile scroll too)
-
When using the compact layout option, the calculation in
/cool-timeline/assets/js/ctl_compact_scripts.min.js
that applies the extra height to the parent wrapper is being applied after every timeline element, so the height of the wrapper is being “shrunk” down to the size of 1 element, and then increased as the loop continues. This causes the entire page to scroll back up as the browser sees the wrapper height has been shrunk down to be very short, and then once the loop is completed the scroll stays at the top.The easiest fix is to only apply the
$(parent_wrapper).css({height:firstBottom+'px'})
once the loop has completed (or add a conditional to make sure it is on the last element in the loop).
- The topic ‘Compact layout jumps to top when window resized (mobile scroll too)’ is closed to new replies.