Generate scroll function if nav is too long