var scrollTarget = $($(this).attr("href"));
// console.log(scrollTarget);
if (scrollTarget) {
- $('body, html').animate({
- scrollTop: scrollTarget.offset().top-90
- }, 300);
+ if ($(window).width() > 1280) {
+ $('body, html').animate({
+ scrollTop: scrollTarget.offset().top-90
+ }, 300);
+ } else {
+ $('body, html').animate({
+ scrollTop: scrollTarget.offset().top-120
+ }, 300);
+ }
}
target = $(this).attr('id').split("-")[1];
parent_target = $(this).parents('.parent-container').attr('id').split("-")[1];
$(".static-nav-link").click(function(e) {
e.preventDefault();
var scrollTarget = $($(this).attr("href"));
-// console.log(scrollTarget);
if (scrollTarget) {
- $('body, html').animate({
- scrollTop: scrollTarget.offset().top-120
- }, 300);
+ if ($(window).width() > 1280) {
+ $('body, html').animate({
+ scrollTop: scrollTarget.offset().top-90
+ }, 300);
+ } else {
+ $('body, html').animate({
+ scrollTop: scrollTarget.offset().top-120
+ }, 300);
+ }
}
});
$(".static-home-link").click(function(e) {
e.preventDefault();
var scrollTarget = $('.home');
-// console.log(scrollTarget);
if (scrollTarget) {
- $('body, html').animate({
- scrollTop: scrollTarget.offset().top-120
- }, 300);
+ if ($(window).width() > 1280) {
+ $('body, html').animate({
+ scrollTop: scrollTarget.offset().top-90
+ }, 300);
+ } else {
+ $('body, html').animate({
+ scrollTop: scrollTarget.offset().top-120
+ }, 300);
+ }
}
});
function setActiveNavItem() {
- console.log("here");
$(".nav-parent").each(function() {
if ( $('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').not(".active") ) {
if(myTopPosition > $(this).offset().top && ( $(this).offset().top + $(this).next().outerHeight() > myTopPosition-90) ) {
-
$('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').addClass("active");
} else {
- //console.log("no");
$('.top-nav-right-list a[href="#' + $(this).attr("id") +'"]').removeClass("active");
}
}