-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
29 lines (23 loc) · 825 Bytes
/
main.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
/* -------------SHOW FRAME WHEN ALBUM IMG CLICKED-------------*/
function showFrame(element) {
var frame = document.getElementById(element.id+'-frame');
if (frame.style.display == 'block') {
frame.style.display = 'none';
} else {
frame.style.display = 'block';
}
}
/* -------------BACK TO TOP BUTTON FUNCTIONALITIES--------------*/
// ===== Scroll to Top ====
$(window).scroll(function () {
if ($(this).scrollTop() >= 50) { // If page is scrolled more than 50px
$('#top').fadeIn("fast"); // Fade in the arrow
} else {
$('#top').fadeOut("fast"); // Else fade out the arrow
}
});
$('#top').click(function () { // When arrow is clicked
$('body,html').animate({
scrollTop: 0 // Scroll to top of body
}, 500);
});