This repository was archived by the owner on Dec 12, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.js
More file actions
51 lines (43 loc) · 1.49 KB
/
script.js
File metadata and controls
51 lines (43 loc) · 1.49 KB
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
/*global $*/
$(document).ready(function() {
var splashHeight = $('.splash').outerHeight();
$.ajax({url: "./pages/home.html", success: function(result){
checkExternal();
$(".well").html(result);
}});
checkMobile();
$('.fa-chevron-down').click(function(){//auto scroll with chevron
var height = splashHeight / 4 * 3;
$('body').animate({scrollTop: height}, 2000);//.scrollTop(splashHeight);
});
$(window).scroll(function(){
var smallHeader = $('.smallHeader');
var chevron = $('.fa-chevron-down');
// console.log($('body').scrollTop());
if($('body').scrollTop() > (splashHeight / 3 * 2)) {
smallHeader.attr('hidden', false);
chevron.hide();
} else {
smallHeader.attr('hidden', true);
chevron.show();
}
});
$('nav li').click(function() {
var url = $(this).text().toLowerCase();
$.ajax({url: "./pages/" + url + ".html", success: function(result){
$(".well").html(result);
}
});
});
function checkExternal() {
$('.external').each(function() {
//$(this).before('<i class="fa fa-external-link" aria-hidden="true"></i>');
$(this).attr('target','_blank');
});
}
function checkMobile() {
if(window.innerWidth <= 800) {
$('.smallHeader').css({'background':'rgba(245,245,245,0.95'});
}
}
});