-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbasic-javascript.js
More file actions
73 lines (61 loc) · 2.59 KB
/
basic-javascript.js
File metadata and controls
73 lines (61 loc) · 2.59 KB
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
/* Used in single player (HTML page 2) */
/* Function called on load by body tag */
/* Function SinglePlayerDataExtract() is used to extract data for bottom music player display send by page music player (HTML page 1) to single player (HTML page 2)*/
function SinglePlayerDataExtract() {
var getBottomPlayer = document.getElementById("bottom-music-player");
var searchData = decodeURIComponent(window.location.search);
searchData=searchData.substring(3);
getBottomPlayer.style.display = searchData;
}
/* Used in music player project (HTML page 1) */
/* Function called on click of "Popular Artist-Coldplay" to redirect to HTML page 2 */
/* Function RedirectToPage2() is used to send data for bottom music player display by page music player (HTML page 1) to single player (HTML page 2) and
also redirects to HTML Page 2 from HTML Page 1*/
function RedirectToPage2() {
var getBottomPlayer = document.getElementById("bottom-music-player");
if(getBottomPlayer.style.display === "block"){
getBottomPlayer= "block";
}
else{
getBottomPlayer = "none";
}
window.location.href="single-player.html?x="+getBottomPlayer;
}
/* Used in music player project (HTML page 1) */
/* Function called on click of "Latest Release" Onism image -1 */
/* Function bottomMusicPlayer1() is called on click of "Latest Release" Onism image -1 which displays bottom music player on click and hide the bottom music
player on clicking pause */
function bottomMusicPlayer1() {
var audio = document.getElementById("audio");
var getBottomPlayer = document.getElementById("bottom-music-player");
var pause = document.getElementById("pause");
var play = document.getElementById("play");
if(getBottomPlayer.style.display === "none"){
getBottomPlayer.style.display = "block";
pause.style.display = "block";
play.style.display = "none";
audio.play();
}
else{
getBottomPlayer.style.display = "none";
pause.style.display = "none";
play.style.display = "block";
audio.pause();
}
}
/* Used in music player project (HTML page 1) */
/* Function called on click of "Latest Release" Onism image -2,3 and 4 */
/* Function bottomMusicPlayer234() is called on click of "Latest Release" Onism image -2,3 and 4 which displays bottom music player on click and hide the
bottom music player on clicking play again */
function bottomMusicPlayer234() {
var audio = document.getElementById("audio");
var getBottomPlayer = document.getElementById("bottom-music-player");
if(getBottomPlayer.style.display === "none"){
getBottomPlayer.style.display = "block";
audio.play();
}
else{
getBottomPlayer.style.display = "none";
audio.pause();
}
}