improving transition when changing display property for a smoother sliding