Right now I am working on a website that is fluid, but I am having some problems with the Jquery/Javascript. As of right now, once the user begins to scroll down the page, js fades the navigation bar in and changes the color of the text within the navigation bar. A dummy site with the link can be found at . However, once the browser is resized to 960px, I want the Jquery to disable because the effects that it provides are no longer needed. One of my professors at school said I should use window.length feature, but after looking it up and trying some things, I can't seem to figure it out. He said its relatively easy, but I think I might just be screwing some things up in my syntax as I am very new to Javascript and Jquery.
Here is the js code:
$(function() {
var navigationIn = false;
if ($(window).width() > 960) {
$('body').animate({scrollTop: 0}, 10, function() {
$(window).scroll(function() {
var pos = $(this).scrollTop();
//console.log("color", color);
if (pos > 5 && navigationIn == false) {
$('#navigation').animate({
opacity: .95,
}, 500);
$('.menu').animate({
color: "000000",
}, 250);
$('#whitelogo').animate({
opacity: 0,
}, 500);
$('#bluelogo').animate({
opacity: 1,
}, 500);
navigationIn = true;
} else if (pos < 5 && navigationIn == true) {
$('#navigation').animate({
opacity: 0,
}, 500);
$('.menu').animate({
color: "FFFFFF",
}, 250);
$('#whitelogo').animate({
opacity: 1,
}, 500);
$('#bluelogo').animate({
opacity: 0,
}, 500);
navigationIn = false;
}
});
});
} else if () {
}
});