-
Notifications
You must be signed in to change notification settings - Fork 0
/
page-aid.php
72 lines (52 loc) · 1.29 KB
/
page-aid.php
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
63
64
65
66
67
68
69
70
71
72
<?php get_header(); ?>
<div id="content">
<div class="subcontainer">
<?php if ( have_posts() ):
while ( have_posts() ): the_post(); ?>
<h3><?php the_title(); ?></h3>
<?php endwhile;
endif;
?>
<?php
wp_nav_menu( array(
'theme_location' => 'sponsors',
'container' => false,
'menu_class' => 'nav nav-tabs'
)
);
?>
<div id="target" class="col-xs-12 col-md-9"></div>
<div class="col-xs-12 col-md-3">
<?php get_sidebar(); ?>
</div>
</div> <!-- .subcontainer -->
</div> <!-- #content -->
<?php get_footer(); ?>
<script>
jQuery(document).ready(function($) {
startAnimation();
loadPage();
$('#menu-sponsors-nav > li').on('click', function() {
startAnimation();
setTimeout(loadPage, 50);
});
function loadPage() {
var hash = window.location.hash;
if (!hash) {
hash = $('#menu-sponsors-nav > li').first().text()
.toLowerCase().replace(' ', '-');
}
$('#target').load('<?php the_permalink(); ?>'
+ hash.replace('#', '/'), function() {
stopAnimation();
});
}
function startAnimation() {
$('#target').addClass('loading');
$('#subcontent').replaceWith('<div class="modal"></div>');
}
function stopAnimation() {
$('#target').removeClass('loading');
}
});
</script>