-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsite.js
56 lines (55 loc) · 1.37 KB
/
site.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
var pages = {
home: {
background: "#fff",
data: "#home",
color: "#4d4045",
btn: "#btn-home"
},
works: {
background: "#3c71d1",
data: "#works",
color: "#fff",
btn: "#btn-works"
},
us: {
background: "#5eb556",
data: "#us",
color: "#fff",
btn: "#btn-us"
}
}
function flash(callback) {
$("#show").fadeOut(function(){
callback();
$("#show").fadeIn();
});
}
$("document").ready(function() {
$(".comment-ctrl").click(function() {
$(".comment-container").css("top", "0px");
});
$(".comment-close").click(function() {
$(".comment-container").css("top", "100%");
});
$(pages.home.btn).click(function() {
$("html").css("background", pages.home.background);
$("#show").css("color", pages.home.color);
flash(function(){
$("#show").html($(pages.home.data)[0].innerHTML);
})
});
$(pages.works.btn).click(function() {
$("html").css("background", pages.works.background);
$("#show").css("color", pages.works.color);
flash(function(){
$("#show").html($(pages.works.data)[0].innerHTML);
})
});
$(pages.us.btn).click(function() {
$("html").css("background", pages.us.background);
$("#show").css("color", pages.us.color);
flash(function(){
$("#show").html($(pages.us.data)[0].innerHTML);
})
});
});