fix javascript so orientation class applied before fadeTo