Challenge: How can I ensure that the code within the if statement only executes when the screen width exceeds 767px, and does not work if it is less than 767px?
Using jQuery:
$(document).ready(function() {
$(window).resize(function() {
if ($(document).width() > 767) {
$('.navigation-hide').hide();
$("nav").mouseenter(function() {
$('.navigation-hide').stop().fadeIn(500);
});
$('nav').mouseleave(function() {
$('.navigation-hide').stop().fadeOut(500);
});
}
else {
// Do nothing
}
});
});