Ok, I’m not really a huge fan of CFWINDOW, despite this being the second blog post in a row about them. That being said, I thought I’d recreate a trick (see PS below) with CFWINDOW that maybe some folks will find useful. The trick involves keeping CFWINDOW in a position and making it stick there as you scroll. It is probably best if you see it live:
- Notice scrolls
- When they scroll, note the position of the scroll and start an interval
- Figure out how far 'off' the CFWINDOW is from where it should be and go 90% of the way there.
- If the distance is less than some threshold, just set it and stop the interval
A bit silly, but fun! The complete code is here: