The below code changes the orientation of my navigation by adding/removing a class name. How can I make it fade in and out when the orientation occurs? Here's my code:
$(window).scroll(function() {
($("#another-reason-to-attend").offset().top <= window.pageYOffset) ? $("#prim").addClass("horizontal") : $("#prim").removeClass("horizontal");
($("#another-reason-to-attend").offset().top <= window.pageYOffset) ? $("#logo").addClass("small") : $("#logo").removeClass("small");
});
EDIT
I've tried adding .fadeIn and .fadeOut to the lines above but it just breaks.
Example:
($("#another-reason-to-attend").offset().top <= window.pageYOffset) ? $("#prim").addClass.fadeIn("horizontal") : $("#prim").removeClass.fadeOut("horizontal");