forked from vinayakgavariya/PlaylistAdda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
40 lines (31 loc) · 891 Bytes
/
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
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();
}
});
$("#toTopBtn").click(function () {
$("html, body").animate(
{
scrollTop: 0,
},
1000
);
return false;
});
});