Ssccb12040 (Talk | contribs) |
Ssccb12040 (Talk | contribs) |
||
Line 64: | Line 64: | ||
}); | }); | ||
}); | }); | ||
− | |||
− | |||
− | |||
− | |||
− |
Latest revision as of 02:40, 30 October 2017
function moveTimeout(t, i) {
setTimeout(function() { window.scrollTo(0, i); }, t * 20); }
function scrollto(id){ time_delay = 0; var temp =document.documentElement.scrollTop; var destination = $(id).offset().top-80; if(temp < destination){ while(temp+30 <= (destination+50)){ moveTimeout(time_delay,temp); temp+=10; time_delay+=0.05; } moveTimeout(time_delay,temp); } else{ while(temp-30 >= destination){ moveTimeout(time_delay,temp); temp-=10; time_delay+=0.05; } moveTimeout(time_delay,temp); } }
function moveTimeout(t, i) { setTimeout(function() { window.scrollTo(0, i); }, t * 20); }
function scrollbot(id){ time_delay = 0; var temp =document.documentElement.scrollTop; var destination = $(id).offset().top; while(temp+20 <= destination){ moveTimeout(time_delay,temp); temp+=20; time_delay+=1; } moveTimeout(time_delay,temp);
}
$(document).ready(function() { // Transition effect for navbar $(window).scroll(function() { // checks if window is scrolled more than 300px, adds/removes solid class if ($(this).scrollTop() >= 680) { // $('.navbar').addClass('solid'); var position = $("#sidemenu").position(); if(position == undefined){} else{ $('#sidemenu').css({"position": "fixed", "top": "35px","left": position.left}); } } else { // $('.navbar').removeClass('solid'); $('#sidemenu').removeAttr('style'); } }); });