-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
62 lines (55 loc) · 1.76 KB
/
index.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
59
60
61
62
$(document).ready(function() {
//your code here
$('.direct_show').each(function () {
$(this).addClass("fade_in");
});
/*
$('.later_show').each(function () {
var imagePos = $(this).offset().top;
var imageHeight = $(this).height();
var topOfWindow = $(window).scrollTop();
var botOfWindow = $(document).height() - $(window).height() - $(window).scrollTop();
if(topOfWindow >= imagePos-400){
$(this).addClass("fade_in");
$(this).removeClass("element-to-hide");
}
});*/
});
function ShowAbstract(id) {
var x = document.getElementById(id);
if (x.style.display == "block") {
x.style.display = "none";
} else {
x.style.display = "block";
}
}
$(window).scroll(function () {
$('.later_show').each(function () {
var imagePos = $(this).offset().top;
var imageHeight = $(this).height();
var topOfWindow = $(window).scrollTop();
var botOfWindow = $(document).height() - $(window).height() - $(window).scrollTop();
var fixOffset = 600;
/*if (imagePos + imageHeight*0.75 < botOfWindow) {
$(this).addClass("fade_in");
$(this).removeClass("element-to-hide");
$(this).removeClass("later_show");
}*/
if(topOfWindow >= imagePos - fixOffset){
$(this).addClass("fade_in");
$(this).removeClass("element-to-hide");
}
});
});
/*
$(window).scroll(function () {
$('.later_show').each(function () {
var scrollTop = _scrollTop();
var elementTop = $(this).offsetTop;
if (scrollTop > elementTop) {
$(this).addClass("fade_in");
$(this).removeClass("element-to-hide");
}
});
});
*/