There block1, which is fixed when you scroll the page, it works correctly until, until you click the switch, and does not appear block2. After appeared block2, block1, which is triggered early and it turns out that block1 is jumping.
https://jsfiddle.net/g9snennj/2/