Line 15: | Line 15: | ||
var homePos = $("#home").offset().top; | var homePos = $("#home").offset().top; | ||
− | var | + | var abstractPos = $("#abstract").offset().top; |
− | var | + | var descrPos = $("#descr").offset().top; |
− | var | + | var detailsPos = $("#details").offset().top; |
var ourTeamPos = $("#ourTeam").offset().top; | var ourTeamPos = $("#ourTeam").offset().top; | ||
var sponsorsPos = $("#sponsors").offset().top; | var sponsorsPos = $("#sponsors").offset().top; | ||
− | var | + | var contactUsPos = $("#contactUs").offset().top; |
$(document).on("click", "#pagedown", function() { | $(document).on("click", "#pagedown", function() { | ||
− | $("body, html").animate({scrollTop: | + | $("body, html").animate({scrollTop: abstractPos+2}, 1000, "swing"); |
}); | }); | ||
$(document).on("click", "#homeMenu", function() { | $(document).on("click", "#homeMenu", function() { | ||
$("body, html").animate({scrollTop: 0}, 1000, "swing"); | $("body, html").animate({scrollTop: 0}, 1000, "swing"); | ||
}); | }); | ||
− | $(document).on("click", "# | + | $(document).on("click", "#abstractMenu", function() { |
− | $("body, html").animate({scrollTop: | + | $("body, html").animate({scrollTop: abstractPos+2}, 1000, "swing"); |
}); | }); | ||
− | $(document).on("click", "# | + | $(document).on("click", "#descrMenu", function() { |
− | $("body, html").animate({scrollTop: | + | $("body, html").animate({scrollTop: descrPos}, 1000, "swing"); |
}); | }); | ||
− | $(document).on("click", "# | + | $(document).on("click", "#detailsMenu", function() { |
− | $("body, html").animate({scrollTop: | + | $("body, html").animate({scrollTop: detailsPos}, 1000, "swing"); |
}); | }); | ||
$(document).on("click", "#ourTeamMenu", function() { | $(document).on("click", "#ourTeamMenu", function() { | ||
Line 43: | Line 43: | ||
$("body, html").animate({scrollTop: sponsorsPos}, 1000, "swing"); | $("body, html").animate({scrollTop: sponsorsPos}, 1000, "swing"); | ||
}); | }); | ||
− | $(document).on("click", "# | + | $(document).on("click", "#contactUsMenu", function() { |
− | $("body, html").animate({scrollTop: | + | $("body, html").animate({scrollTop: contactUsPos}, 1000, "swing"); |
}); | }); | ||
Line 65: | Line 65: | ||
$(window).scroll(function(){ | $(window).scroll(function(){ | ||
var windowPos = $(window).scrollTop() + 1; | var windowPos = $(window).scrollTop() + 1; | ||
− | if (windowPos >= homePos && windowPos < | + | if (windowPos >= homePos && windowPos < abstractPos - halfHeight) { |
$(".pagelink").css("background-color","transparent"); | $(".pagelink").css("background-color","transparent"); | ||
$(".pagelink").children().children().css("color","#bbbbbb"); | $(".pagelink").children().children().css("color","#bbbbbb"); | ||
Line 71: | Line 71: | ||
$(".pagelink#homeMenu div p").css("color","black"); | $(".pagelink#homeMenu div p").css("color","black"); | ||
} | } | ||
− | else if (windowPos >= | + | else if (windowPos >= abstractPos - halfHeight && windowPos < descrPos - halfHeight) { |
$(".pagelink").css("background-color","transparent"); | $(".pagelink").css("background-color","transparent"); | ||
$(".pagelink").children().children().css("color","#bbbbbb"); | $(".pagelink").children().children().css("color","#bbbbbb"); | ||
− | $(".pagelink# | + | $(".pagelink#abstractMenu").css("background-color","#bbbbbb"); |
− | $(".pagelink# | + | $(".pagelink#abstractMenu div p").css("color","black"); |
} | } | ||
− | else if (windowPos >= | + | else if (windowPos >= descrPos - halfHeight && windowPos < detailsPos - halfHeight) { |
$(".pagelink").css("background-color","transparent"); | $(".pagelink").css("background-color","transparent"); | ||
$(".pagelink").children().children().css("color","#bbbbbb"); | $(".pagelink").children().children().css("color","#bbbbbb"); | ||
− | $(".pagelink# | + | $(".pagelink#descrMenu").css("background-color","#bbbbbb"); |
− | $(".pagelink# | + | $(".pagelink#descrMenu div p").css("color","black"); |
} | } | ||
− | else if (windowPos >= | + | else if (windowPos >= detailsPos - halfHeight && windowPos < ourTeamPos - halfHeight) { |
$(".pagelink").css("background-color","transparent"); | $(".pagelink").css("background-color","transparent"); | ||
$(".pagelink").children().children().css("color","#bbbbbb"); | $(".pagelink").children().children().css("color","#bbbbbb"); | ||
− | $(".pagelink# | + | $(".pagelink#detailsMenu").css("background-color","#bbbbbb"); |
− | $(".pagelink# | + | $(".pagelink#detailsMenu div p").css("color","black"); |
} | } | ||
else if (windowPos >= ourTeamPos - halfHeight && windowPos < sponsorsPos - halfHeight) { | else if (windowPos >= ourTeamPos - halfHeight && windowPos < sponsorsPos - halfHeight) { | ||
Line 95: | Line 95: | ||
$(".pagelink#ourTeamMenu div p").css("color","black"); | $(".pagelink#ourTeamMenu div p").css("color","black"); | ||
} | } | ||
− | else if (windowPos >= sponsorsPos - halfHeight && windowPos < | + | else if (windowPos >= sponsorsPos - halfHeight && windowPos < contactUsPos - halfHeight) { |
$(".pagelink").css("background-color","transparent"); | $(".pagelink").css("background-color","transparent"); | ||
$(".pagelink").children().children().css("color","#bbbbbb"); | $(".pagelink").children().children().css("color","#bbbbbb"); | ||
Line 101: | Line 101: | ||
$(".pagelink#sponsorsMenu div p").css("color","black"); | $(".pagelink#sponsorsMenu div p").css("color","black"); | ||
} | } | ||
− | else if (windowPos >= | + | else if (windowPos >= contactUsPos - halfHeight) { |
$(".pagelink").css("background-color","transparent"); | $(".pagelink").css("background-color","transparent"); | ||
$(".pagelink").children().children().css("color","#bbbbbb"); | $(".pagelink").children().children().css("color","#bbbbbb"); | ||
− | $(".pagelink# | + | $(".pagelink#contactUsMenu").css("background-color","#bbbbbb"); |
− | $(".pagelink# | + | $(".pagelink#contactUsMenu div p").css("color","black"); |
} | } | ||
− | }); | + | }); |
− | + | ||
− | + | ||
− | + | ||
}); | }); |
Revision as of 09:16, 27 July 2018
$(window).on('resize',function() {
location.reload();
});
$(window).on("load", function() {
//navmenubar var sticky = $("#menubar").offset().top; $(window).scroll(function() { if ($(window).scrollTop() > sticky) { $("#menubar").addClass("stickymenu"); } else { $("#menubar").removeClass("stickymenu"); } });
var homePos = $("#home").offset().top;
var abstractPos = $("#abstract").offset().top; var descrPos = $("#descr").offset().top; var detailsPos = $("#details").offset().top; var ourTeamPos = $("#ourTeam").offset().top; var sponsorsPos = $("#sponsors").offset().top; var contactUsPos = $("#contactUs").offset().top;
$(document).on("click", "#pagedown", function() {
$("body, html").animate({scrollTop: abstractPos+2}, 1000, "swing"); }); $(document).on("click", "#homeMenu", function() {
$("body, html").animate({scrollTop: 0}, 1000, "swing"); }); $(document).on("click", "#abstractMenu", function() { $("body, html").animate({scrollTop: abstractPos+2}, 1000, "swing"); }); $(document).on("click", "#descrMenu", function() { $("body, html").animate({scrollTop: descrPos}, 1000, "swing"); }); $(document).on("click", "#detailsMenu", function() { $("body, html").animate({scrollTop: detailsPos}, 1000, "swing"); }); $(document).on("click", "#ourTeamMenu", function() { $("body, html").animate({scrollTop: ourTeamPos}, 1000, "swing"); }); $(document).on("click", "#sponsorsMenu", function() { $("body, html").animate({scrollTop: sponsorsPos}, 1000, "swing"); }); $(document).on("click", "#contactUsMenu", function() { $("body, html").animate({scrollTop: contactUsPos}, 1000, "swing"); });
$(".pagelink#registerMenu").click(function() { $("#register").css("left","30vw"); $("#login").css("left","-35vw"); }); $(".pagelink#loginMenu").click(function() { $("#login").css("left","35vw"); $("#register").css("left","-45vw"); }); $("#register .exit").click(function() { $("#register").css("left","-45vw"); }); $("#login .exit").click(function() { $("#login").css("left","-35vw"); });
var halfHeight = window.innerHeight/2; $(window).scroll(function(){ var windowPos = $(window).scrollTop() + 1; if (windowPos >= homePos && windowPos < abstractPos - halfHeight) { $(".pagelink").css("background-color","transparent"); $(".pagelink").children().children().css("color","#bbbbbb"); $(".pagelink#homeMenu").css("background-color","#bbbbbb"); $(".pagelink#homeMenu div p").css("color","black"); } else if (windowPos >= abstractPos - halfHeight && windowPos < descrPos - halfHeight) { $(".pagelink").css("background-color","transparent"); $(".pagelink").children().children().css("color","#bbbbbb"); $(".pagelink#abstractMenu").css("background-color","#bbbbbb"); $(".pagelink#abstractMenu div p").css("color","black"); } else if (windowPos >= descrPos - halfHeight && windowPos < detailsPos - halfHeight) { $(".pagelink").css("background-color","transparent"); $(".pagelink").children().children().css("color","#bbbbbb"); $(".pagelink#descrMenu").css("background-color","#bbbbbb"); $(".pagelink#descrMenu div p").css("color","black"); } else if (windowPos >= detailsPos - halfHeight && windowPos < ourTeamPos - halfHeight) { $(".pagelink").css("background-color","transparent"); $(".pagelink").children().children().css("color","#bbbbbb"); $(".pagelink#detailsMenu").css("background-color","#bbbbbb"); $(".pagelink#detailsMenu div p").css("color","black"); } else if (windowPos >= ourTeamPos - halfHeight && windowPos < sponsorsPos - halfHeight) { $(".pagelink").css("background-color","transparent"); $(".pagelink").children().children().css("color","#bbbbbb"); $(".pagelink#ourTeamMenu").css("background-color","#bbbbbb"); $(".pagelink#ourTeamMenu div p").css("color","black"); } else if (windowPos >= sponsorsPos - halfHeight && windowPos < contactUsPos - halfHeight) { $(".pagelink").css("background-color","transparent"); $(".pagelink").children().children().css("color","#bbbbbb"); $(".pagelink#sponsorsMenu").css("background-color","#bbbbbb"); $(".pagelink#sponsorsMenu div p").css("color","black"); } else if (windowPos >= contactUsPos - halfHeight) { $(".pagelink").css("background-color","transparent"); $(".pagelink").children().children().css("color","#bbbbbb"); $(".pagelink#contactUsMenu").css("background-color","#bbbbbb"); $(".pagelink#contactUsMenu div p").css("color","black"); } });
});