-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathui.js
30 lines (24 loc) · 911 Bytes
/
ui.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
$(document).ready(function() {
// collapse all but the first episode
$("div.EpisodeContent").hide();
$("div.EpisodeContent:first").show();
// set the correct expand/collapse icon
$("img.ColExpIcon").attr('src','images/expand.png');
$("img.ColExpIcon:first").attr('src','images/collapse.png');
// toggle the cursor type when hovering over the episode header
$('h3.Heading').css('cursor', 'pointer');
// Handle click on a title - expand or collapse
$("h3.Heading").click(function() {
const delay = 300;
var h = "#Content-" + $(this).attr("id");
var ec = "ColExp-"+ $(this).attr("id");
if ($(h).is(":hidden")) {
$(h).slideDown(delay);
document.getElementById(ec).src="images/Collapse.png";
}
else {
$(h).slideUp(delay);
document.getElementById(ec).src="images/Expand.png";
}
})
});