-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpage-control.js
48 lines (46 loc) · 1.33 KB
/
page-control.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
/**
* Change the pages
*/
function pages() {
setTimeout('pages()',50);
var page;
page = location.hash;
switch(page) {
case '#home':
$('#about').removeClass('SlideIn');
$('#home').removeClass('SlideOut');
$('#about').addClass('SlideOut');
$('#home').addClass('SlideIn');
setTimeout("$('#about').removeClass('page-current')",500);
setTimeout("$('#home').addClass('page-current')",500);
$('#home-link').addClass('active');
$('#about-link').removeClass('active');
break;
case '#about':
$('#home').removeClass('SlideIn');
$('#about').removeClass('SlideOut');
$('#home').addClass('SlideOut');
$('#about').addClass('SlideIn');
setTimeout("$('#home').removeClass('page-current')",500);
setTimeout("$('#about').addClass('page-current')",500);
$('#about-link').addClass('active');
$('#home-link').removeClass('active');
break;
default:
break;
}
}
$(function(){
$('#about').removeClass('SlideIn');
$('#home').removeClass('SlideOut');
$('#home').addClass('SlideIn');
setTimeout("$('#home').addClass('page-current')",500);
$('#home-link').addClass('active');
$('#about-link').removeClass('active');
pages();
$('#home-link').click(function(event){
if(location.hash !== '#home' && location.hash !== '#about') {
event.preventDefault();
}
});
});