-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
58 lines (43 loc) · 1.12 KB
/
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
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
/*
jQuery;
*/
"use strict";
jQuery(document).ready(function ($) {
$(window).load(function () {
$(".loaded").fadeOut();
$(".preloader").delay(1000).fadeOut("slow");
});
jQuery('.scrollup').click(function () {
$("html, body").animate({scrollTop: 0}, 2000);
return false;
});
jQuery('.nav a').bind('click', function () {
$('html , body').stop().animate({
scrollTop: $($(this).attr('href')).offset().top - 80
}, 1500, 'easeInOutExpo');
event.preventDefault();
});
jQuery(window).scroll(function () {
var top = jQuery(document).scrollTop();
var height = 300;
//alert(batas);
if (top > height) {
jQuery('.navbar-fixed-top').addClass('menu-scroll');
} else {
jQuery('.navbar-fixed-top').removeClass('menu-scroll');
}
});
// Scroll up
$(window).scroll(function(){
if ($(this).scrollTop() > 600) {
$('.scrollup').fadeIn('slow');
} else {
$('.scrollup').fadeOut('slow');
}
});
$('.scrollup').click(function(){
$("html, body").animate({ scrollTop: 0 }, 1000);
return false;
});
new WOW().init();
});