Fixed sliding window behavior to work for resize.