-
-
Notifications
You must be signed in to change notification settings - Fork 166
/
index.js
58 lines (44 loc) · 1.22 KB
/
index.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
function searchPlaylist() {
var filter_text = document.getElementById("search_bar").value.toUpperCase();
var card = document.getElementsByClassName("card");
for (var i = 0; i < card.length; i++) {
var title = card[i].getElementsByClassName("title")[0];
var str = title.innerText || title.textContent;
if (str.toUpperCase().indexOf(filter_text) > -1) {
card[i].style.display = "";
} else {
card[i].style.display = "none";
}
}
}
$(document).ready(function () {
$(window).scroll(function () {
if ($(this).scrollTop() > 20) {
$("#toTopBtn").fadeIn();
} else {
$("#toTopBtn").fadeOut();
}
if ($(this).scrollTop() > 20) {
$("#toBotBtn").fadeIn();
} else {
$("#toBotBtn").fadeOut();
}
});
$("#toTopBtn").click(function () {
$("html, body").animate(
{
scrollTop: 0,
},
1000
);
return false;
});
$("#toBotBtn").click(function () {
$("html, body").animate({ scrollTop: $(document).height() }, 1000);
return false;
});
});
function show_bar() {
$("#search-icon").hide();
$("#search_bar").show();
}