-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
50 lines (46 loc) · 1.44 KB
/
script.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
$("#fun span").mouseover(function () {
$(document).mousemove(function (e) {
$("#fun span img", this).offset({
left: e.pageX,
top: e.pageY - 50,
});
});
});
$("#study span").mouseover(function () {
$(document).mousemove(function (e) {
$("#study span img", this).offset({
left: e.pageX,
top: e.pageY - 50,
});
});
});
var offsetTop = $("#page1").offset().bottom;
function isOverlapping(e1, e2) {
var rect1 = e1.getBoundingClientRect();
var rect2 = e2.getBoundingClientRect();
var overlap = !(
rect1.right < rect2.left ||
rect1.left > rect2.right ||
rect1.bottom < rect2.top ||
rect1.top > rect2.bottom
);
return overlap;
}
$(window).scroll(function () {
// var sidebarTop=$(window).scrollTop() + $("#sidebar").position().top;
// var sidebarBottom=$(window).scrollTop() + $("#sidebar").position().top + $("#sidebar").outerHeight(true);
// var header2Top=$(window).scrollTop() + $("#skills-tools h2").position().top + $("#skills-tools h2").offset().top;
// var header2Bottom=$(window).scrollTop() + $("#skills-tools h2").position().top + $("#skills-tools h2").offset().top + $("#skills-tools h2").outerHeight(true);
if (
$(window).scrollTop() + $(window).height() >
$("#job h1").position().top +
$("#job h1").offset().top +
$("#job h1").outerHeight(true) +
100
) {
$("#sidebar").fadeIn();
}
else {
$("#sidebar").fadeOut();
}
});