Skip to content

Commit

Permalink
Fixed double kanye, and button interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
sagangwee committed Oct 12, 2015
1 parent 621cdc6 commit e2252fd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
// Kanyebtn.addEventListener("click", beat("Kanye"));

function beat(name) {
if (name === "Kendrick") {
if (audio.src != 'rap_app_instrumentals/freestyle_rap.mp3') {
audio.src = 'rap_app_instrumentals/freestyle_rap.mp3';
} else if (name === "Kendrick") {
audio.src = 'rap_app_instrumentals/money_trees.mp3';
} else if (name === "Drake") {
audio.src = 'rap_app_instrumentals/back_to_back.mp3';
Expand All @@ -58,11 +60,12 @@
}
if (audio.paused) {
audio.play();
startbtn.innerHTML = '<button type="button">Stop</button>'
}
}

$('#Drake').click(function() { beat('Drake'); });
$('#Cole').click(function() { beat('Kanye'); });
$('#Cole').click(function() { beat('Cole'); });
$('#Kanye').click(function() { beat('Kanye'); });
$('#Kendrick').click(function() { beat('Kendrick'); });

Expand Down

0 comments on commit e2252fd

Please sign in to comment.