mcmxl22 sends brownie points to @x140hu4 :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @x140hu4 |http://www.freecodecamp.org/x140hu4
.name {
font-size: 28px;
width: 100%;
text-align: right;
}
#well{
display: flex;
width: 100%;
}
mcmxl22 sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1370 | @sorinr |http://www.freecodecamp.org/sorinr
function usrClick() {
if ($(this).is("#green")) {
userClicks.push(1);
audio[0].play();
checkClicks();
} else if ($(this).is("#red")) {
userClicks.push(2);
audio[1].play();
checkClicks();
} else if ($(this).is("#blue")) {
userClicks.push(3);
audio[2].play();
checkClicks();
} else if ($(this).is("#yellow")) {
userClicks.push(4);
audio[3].play();
checkClicks();
}
console.log(userClicks);
}
Something like this?
teo03 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 915 | @mot01 |http://www.freecodecamp.org/mot01
@c-ciobanu just to make you understand whats happening in your js:
getLocation();
console.log(lat);
so js encounters the function getLocation and calls it and then pass immediately to the next instruction that is console.log(lat) that ofc will display undifined because the getLocation didn't get back yet the response provided by your fallback "showPosition" that will update the lat var. change the global var lat = 0.00;
and you will see that you will get console loged 0.00 and not undefined because you have this time instantiated the var with a default value. hope it makes sense
img
element?
img
element would go in the body
switchCallback
instead of callback
?
<div class="btn" id="one"><img src="#"></img></div>