-
Notifications
You must be signed in to change notification settings - Fork 1
/
footer.php
41 lines (35 loc) · 1009 Bytes
/
footer.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
<?php wp_footer(); ?>
</div>
<script type="text/javascript">
var topPosition = 0;
function flvPrkFixSidebar() {
console.log(topPosition);
if($(window).width() > 992 && $('.sidebar-container').height() < $('.posts-container').height() && $('.sidebar-container').height() < $(window).height()) {
if ($(window).scrollTop() > topPosition) {
$('.sidebar-container').css({
'position': 'fixed',
'top': '0px',
'right': '0px'
});
} else {
$('.sidebar-container').css({
'position': 'relative',
'top': 'auto'
});
}
}
}
$(document).ready(function() {
topPosition = $('.sidebar-container').position().top;
$(window).scroll(flvPrkFixSidebar);
});
jQuery(window).resize(function() {
topPosition = $('.sidebar-container').position().top;
});
jQuery("#menu-button").on("click", function () {
jQuery("#menu-button").toggleClass("opened");
jQuery(".menu-wrapper").toggleClass("opened");
});
</script>
</body>
</html>