-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjsindex.js
More file actions
executable file
·85 lines (80 loc) · 3.34 KB
/
jsindex.js
File metadata and controls
executable file
·85 lines (80 loc) · 3.34 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
function init() {
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
minsize = 30,
startingpoint = $('#logotable').height()+160;
leftright = startingpoint - 60;
$('body').css('padding-top',(startingpoint+25)+'px');
size = startingpoint - distanceY;
imgheight = startingpoint - 30 - distanceY;
maxheight = startingpoint - 30 - leftright;
if (minsize > size) {
$("#header").css( "height", minsize+"px" );
} else {
$("#header").css( "height", size+"px" );
}
if (distanceY > leftright) {
$("#smalllogo").css( "display", "inline" );
$("#smalllogo").css( "float", "left" );
$("#smalllogo").css( "max-height", maxheight+"px" );
} else {
$("#smalllogo").css( "display", "none");
}
window.onresize = function(event) {
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
minsize = 30,
startingpoint = $('#logotable').height()+160;
leftright = startingpoint - 60;
$('body').css('padding-top',(startingpoint+25)+'px');
size = startingpoint - distanceY;
imgheight = startingpoint - 30 - distanceY;
maxheight = startingpoint - 30 - leftright;
if (minsize > size) {
$("#header").css( "height", minsize+"px" );
} else {
$("#header").css( "height", size+"px" );
}
if (distanceY > leftright) {
$("#smalllogo").css( "display", "inline" );
$("#smalllogo").css( "float", "left" );
$("#smalllogo").css( "max-height", maxheight+"px" );
} else {
$("#smalllogo").css( "display", "none");
}
};
window.addEventListener('scroll', function(e){
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
minsize = 30,
startingpoint = $('#logotable').height()+160;
leftright = startingpoint - 60;
$('body').css('padding-top',(startingpoint+25)+'px');
size = startingpoint - distanceY;
imgheight = startingpoint - 30 - distanceY;
maxheight = startingpoint - 30 - leftright;
if (minsize > size) {
$("#header").css( "height", minsize+"px" );
} else {
$("#header").css( "height", size+"px" );
}
if (distanceY > leftright) {
$("#smalllogo").css( "display", "inline" );
$("#smalllogo").css( "float", "left" );
$("#smalllogo").css( "max-height", maxheight+"px" );
} else {
$("#smalllogo").css( "display", "none");
}
});
}
$(document).ready(function() {
$(window).resize(function(){ $('#nav2').css("display", "none");});
$('head').append('<link rel="apple-touch-icon" href="https://www.mathsnz.com/icon.png">');
$('body').append('<img src="https://tracking.jake4maths.com/mathsnzimage.php?url='+window.location.href+'" style="position:absolute;left:-100px;top:-100px;">');
var y = $(window).scrollTop();
$(window).scrollTop(y+1);
});
//google analytics tracking
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36760253-1', 'auto');
ga('send', 'pageview');