-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathscript.js
More file actions
61 lines (46 loc) · 1.86 KB
/
script.js
File metadata and controls
61 lines (46 loc) · 1.86 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
$(document).ready(function() {
var artists = [];
/* TODO: Add a "video" property to each Artist */
var kanye = {
id: 'kanye', // No spaces in this
name: 'Kanye West',
img: 'http://photon.101medialablimit.netdna-cdn.com/hypebeast.com/image/2016/02/kanye-west-nicolas-ghesquiere-1.jpg',
albums: ['Graduation','Watch The Throne','Yeezus']
};
// Add our artist object to the array
artists.push(kanye);
/* TODO: Add another artist to the array (number two) */
/* TODO: Add another artist to the array (number three) */
/* TODO: Add another artist to the array (number four) */
/* This will add the artists to the page */
for(var x=0; x < artists.length; x++){
$('#artists').append(
$('<div/>')
.addClass("artist_name")
.attr("id", artists[x].id)
.text(artists[x].name)
);
/* TODO: Make the artist's image show up */
$('#' + artists[x].id).append(
$('<div/>')
.addClass("artist_image")
.html()
);
var albumString = "Albums include: ";
/* TODO: Make a loop to add the album names to the albumString variable */
// now add the albums to the page
$('#' + artists[x].id).append(
$('<div/>')
.addClass("albums")
.html(albumString)
);
/* TODO: Make the artist video show up and be clickable */
if(artists[x].video && artists[x].video.length > 0){
$('#' + artists[x].id).append(
$('<div/>')
.addClass("video")
.html("")
);
}
}
});