If you check the window size inside the event handler it will be easy.
$('li#portfolio').on('mouseenter', function () {
if ($(window).width() > 960) {
$(this).find('#subNav').addClass('active').hide().stop(true, true).fadeIn(300);
}
}).on('mouseleave', function () {
if ($(window).width() > 960) {
$(this).find('#subNav').stop(true, true).fadeOut(300);
}
});