Add fadeIn/fadeOut to add/remove class

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:\[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");});\[/code\]EDITI've tried adding .fadeIn and .fadeOut to the lines above but it just breaks.Example:\[code\] ($("#another-reason-to-attend").offset().top <= window.pageYOffset) ? $("#prim").addClass.fadeIn("horizontal") : $("#prim").removeClass.fadeOut("horizontal");\[/code\]
 
Back
Top