-
Notifications
You must be signed in to change notification settings - Fork 12
/
script.js
82 lines (66 loc) · 1.72 KB
/
script.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
MathJax.Hub.Config({
tex2jax: {
preview: "none",
inlineMath: [['$', '$'], ["\\(", "\\)"]],
processEscapes: true
},
messageStyle: "none"
});
function setStickyMenu () {
var options = {
bottoming: false,
inner_scrolling: false
};
var sticky = "#TOC";
var width = $(window).width();
if (width >= 768) {
console.log('fold in');
//$(sticky).hide();
//$(sticky).show();
$(sticky).stick_in_parent(options);
// $(".well ul").addClass('menu');
$(".well ul").attr('id', 'accordion-1');
} else {
$(".well ul").attr('id', '');
$(sticky).trigger("sticky_kit:detach");
console.log('fold out');
}
};
$(document).ready(function () {
$(window).on('resize', function () {
setStickyMenu();
});
});
function doAccordion () {
$("#accordion-1").dcAccordion({
eventType: 'click',
autoClose: false,
saveState: false,
disableLink: false,
speed: 0,
showCount: true,
autoExpand: true,
cookie: 'dcjq-accordion-1',
classExpand: 'dcjq-current-parent'
});
}
$(document).ready(function () {
setStickyMenu();
doAccordion();
});
$(document).ready(function () {
$( 'table' ).addClass( "table" );
});
/*
$(window).resize(function() {
if(this.resizeTO) clearTimeout(this.resizeTO);
this.resizeTO = setTimeout(function() {
$(this).trigger('resizeEnd');
}, 200);
});
$(window).bind('resizeEnd', function() {
//do something, window hasn't changed size in 500ms
//window.location = location.pathname + location.hash;
//location.reload();
setStickyMenu();
});*/