-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcustom.js
58 lines (42 loc) · 1.57 KB
/
custom.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
$(function(){ // $(document).ready shorthand
$('.section1').fadeIn('slow');
});
$(document).ready(function() {
/* Every time the window is scrolled ... */
$(window).scroll( function(){
/* Check the location of each desired element */
$('.hideme').each( function(i){
var bottom_of_object = $(this).position().top + $(this).outerHeight();
var bottom_of_window = $(window).scrollTop() + $(window).height();
/* If the object is completely visible in the window, fade it it */
if( bottom_of_window > bottom_of_object ){
$(this).animate({'opacity':'1'},1000);
}
});
});
$("#nav_home_link").click(function (){
$('html, body').animate({
scrollTop: $(".section1").offset().top
}, 2000);
});
$("#nav_about_link").click(function (){
$('html, body').animate({
scrollTop: $(".section_about_me").offset().top
}, 2000);
});
$("#nav_coursework_link").click(function (){
$('html, body').animate({
scrollTop: $(".section2").offset().top
}, 2000);
});
// $("#nav_projects_link").click(function (){
// $('html, body').animate({
// scrollTop: $(".section3").offset().top
// }, 2000);
// });
$("#nav_name_link").click(function (){
$('html, body').animate({
scrollTop: $(".section1").offset().top
}, 2000);
});
});