reacorbett sends brownie points to @otmeek :sparkles: :thumbsup: :sparkles:
:star: 353 | @otmeek | http://www.freecodecamp.com/otmeek
.title {
font-family: Palatino;
font-size: 50px;
}
.heading-image {
height: 500px;
width: 800px;
position: relative;
left: 30px;
}
.surrounding-grey-box {
background-color: #E0E0E0;
padding: 30px;
margin: 45px;
}
.surround-white-box {
background-color: white;
margin-right: 28px;
margin-left:
}
</style>
<body>
<div class='box surrounding-grey-box'>
<h1 class='text-center title'> Sir Wintston Churchill</h1>
<h2 font-size: class='text-center'> <i> The British Bulldog</i> </h2>
<div class='box surround-white-box'>
<img src='http://megamind.ru/upload/medialibrary/076/0768c8fb308172019b3b3cc70e8ac26f.jpg' class='heading-image'></img>
<h5 class='text-center'> Sir Winston Churchill playing a quick game of "Rock, Paper, Scissors" in London.</h5>
</div>
<br>
<br>
<br>
<p class='text-center'> Here's a timeline of Sir Winston Churchills' life:</p>
<ul>
<li> 1943 bla bla bla </li>
</ul>
</div>
</body>
backgroundUrl = "url(https://pixabay.com/static/uploads/photo/2015/08/28/18/25/seattle-912274_960_720.jpg)";
$("body").css("background-image","backgroundUrl")
blayman sends brownie points to @dshgna :sparkles: :thumbsup: :sparkles:
:star: 181 | @dshgna | http://www.freecodecamp.com/dshgna
.heading-image {
height: 500px;
max-width: 800px;
display: block;
margin-left: auto;
margin-right: auto;
}
dshgna sends brownie points to @batilc1 :sparkles: :thumbsup: :sparkles:
:star: 211 | @batilc1 | http://www.freecodecamp.com/batilc1
.heading-image {
height: 500px;
max-width: 800px;
display: block;
margin-left: auto;
margin-right: auto;
}
batilc1 sends brownie points to @dshgna :sparkles: :thumbsup: :sparkles:
:star: 182 | @dshgna | http://www.freecodecamp.com/dshgna
<div> <img/> </div>
if you use relative position on img and have it size 300x300, div will be 300x300 as well. If you use absolute position, div will be 0x0
position: absolute
creates exceptions in your css that you will need to handle manually later on when you build bigger things
thybean sends brownie points to @batilc1 :sparkles: :thumbsup: :sparkles:
:star: 212 | @batilc1 | http://www.freecodecamp.com/batilc1
margin-left: auto
and remove the margin-right
, than your element will always be on the right-most side
thybean sends brownie points to @dshgna :sparkles: :thumbsup: :sparkles:
:star: 183 | @dshgna | http://www.freecodecamp.com/dshgna
function rand_number() {
return (Math.round(Math.random() * 99));
}
function rand_color() {
var color = [rand_number(), rand_number(), rand_number()];
var colors = color.join("");
colors = colors.toString();
return colors;
}
var color = "blue";
var header = "#" + rand_color();
$(document).ready(function() {
$("#new_quote").on("click", function() {
$("body").css("background-color", header);
});
});
[code here]
to make your code appear nicely.
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
```js ⇦ Type 3 backticks and then press [shift + enter ⏎]
(type js or html or css)
<paste your code here>,
then press [shift + enter ⏎]
``` ⇦ Type 3 backticks, then press [enter ⏎]
See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics
[function rand_number() {
return (Math.round(Math.random() * 99));
}
function rand_color() {
var color = [rand_number(), rand_number(), rand_number()];
var colors = color.join("");
colors = colors.toString();
return colors;
}
var color = "blue";
var header = "#" + rand_color();
$(document).ready(function() {
$("#new_quote").on("click", function() {
$("body").css("background-color", header);
});
});
]
'''js
function rand_number() {
return (Math.round(Math.random() * 99));
}
function rand_color() {
var color = [rand_number(), rand_number(), rand_number()];
var colors = color.join("");
colors = colors.toString();
return colors;
}
var color = "blue";
var header = "#" + rand_color();
$(document).ready(function() {
$("#new_quote").on("click", function() {
$("body").css("background-color", header);
});
});
'''
:bulb: to format code use backticks! ``` more info
function rand_number() {
return (Math.round(Math.random() * 99));
}
function rand_color() {
var color = [rand_number(), rand_number(), rand_number()];
var colors = color.join("");
colors = colors.toString();
return colors;
}
var color = "blue";
var header = "#" + rand_color();
$(document).ready(function() {
$("#new_quote").on("click", function() {
$("body").css("background-color", header);
});
});
paulmacovei sends brownie points to @thybean and @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 917 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 130 | @thybean | http://www.freecodecamp.com/thybean
header
inside the click function. That should work as intended
<div class="container" id="quote_box">
<h1>Random Quote Machine </h1>
<p>Twitter Link</p>
<p>Tumblr Link</p>
<div class="row">
<div class="col-xs-12">
<button type="button" class="btn btn-primary" id="new_quote">
<p>Twitter</p></button>
</div>
<div class="col-xs-12">
<div class="button pull-right">
<button type="button" class="btn btn-primary" id="new_quote">
<p>New quote</p>
</div>
</div>
catalinscr sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 919 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
margin-left
for your .heading-image
class
thybean sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 920 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
weatherimg
class? I was just refering to the <img> tag itself, you have a width and height on the img tag of 25%.
img
is intefering I believe.
Array.prototyp.slice
get's that function and then you are using .call
to feed that function the this
value it is supposed to operate on. Normally, if you had an array you could just do arr.slice()
which works becuase in arr
, in my example, has the slice()
method up its prototype chain. arguments
is not an array, so you can't do arguments.slice()
, so we just force javascript to use that method on the arguments
array like object in the manner you posted Array.prototype.slice.call(arguments)
. And since the output of the slice()
method is an array, you now have your arguments in a proper array.
livmaria7891 sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 921 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
@reacorbett you dont have an image defined for your twitter so it doesn't even appear
<div class="col-xs-3">
<a href="#" class="img-responsive" class="twitter"></a>
</div>
it's currently just a link
.twitter{
display:block;
background-image: url('http://i1155.photobucket.com/albums/p543/richard_corbett1/Twitter_graf_zpskmnep2bj.png');
height: 132px;
width: 270px;
}
<div class="col-xs-3">
<span class="twitter img-responsive"></span>
</div>
<div class="col-xs-3">
<a href="#"><span class="twitter img-responsive"></span></a>
</div>
reacorbett sends brownie points to @idietmoran :sparkles: :thumbsup: :sparkles:
:star: 306 | @idietmoran | http://www.freecodecamp.com/idietmoran
.freecc:hover{
background-image:('http://i1155.photobucket.com/albums/p543/richard_corbett1/fccgraf_active_zpsmqx6ewqb.png');
}
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
```js ⇦ Type 3 backticks and then press [shift + enter ⏎]
(type js or html or css)
<paste your code here>,
then press [shift + enter ⏎]
``` ⇦ Type 3 backticks, then press [enter ⏎]
See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics
.twitter{
display:block;
background-image: url('http://i1155.photobucket.com/albums/p543/richard_corbett1/Twitter_graf_zpskmnep2bj.png');
height: 132px;
width: 270px;
}
Hey guys, now this is how far I have gone with the Pomodoro clock, as usual it's a JSFiddle
please be kind to help check if am on track, how can I stop my plus and minus button from interfering with the countdown ?
My guess, a boolean but can't wrap my head around it yet....please help out thanks.
// variable to determine if clock is running
var clockLive = true;
$('#plus').click(function() {
// if clock is not running
if(!clockLive){
// do this
// your code
}
})
lumexralph sends brownie points to @idietmoran :sparkles: :thumbsup: :sparkles:
:star: 310 | @idietmoran | http://www.freecodecamp.com/idietmoran
.text-color {
color: $light-green;
}
.text-color:hover {
background-color: red;
}
jamesthemonkeh sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 290 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
caleb272 sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 913 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
caleb272 sends brownie points to @coymeetsworld :sparkles: :thumbsup: :sparkles:
:star: 291 | @coymeetsworld | http://www.freecodecamp.com/coymeetsworld
pedronfigueiredo sends brownie points to @caleb272 :sparkles: :thumbsup: :sparkles:
:star: 272 | @caleb272 | http://www.freecodecamp.com/caleb272
:bulb: to format code use backticks! ``` more info
viewer httpcodepenioleprekon91penqbzojz why cant i get the json object
leprekon91 sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 513 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
mikenaza sends brownie points to @mbrad26 and @kirbyedy :sparkles: :thumbsup: :sparkles:
:star: 514 | @kirbyedy | http://www.freecodecamp.com/kirbyedy
:star: 281 | @mbrad26 | http://www.freecodecamp.com/mbrad26
@mbrad26 the issue is that your click handler is set for an element that you're creating dynamically. (the .celsius class element does not exist in the DOM when the page is initially loaded). your solution is to slightly adjust the click handler:
// change
$(".celsius").on("click", function() {
// to this
$(".temperature").on("click", ".celsius", function() {
more about the problem here, for example: http://stackoverflow.com/questions/6658752/click-event-doesnt-work-on-dynamically-generated-elements
mbrad26 sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1450 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
gxenos sends brownie points to @jnmorse :sparkles: :thumbsup: :sparkles:
:star: 407 | @jnmorse | http://www.freecodecamp.com/jnmorse
@jnmorse
Cool. If you aren't seeing scroll bars except for within that one div, that's perfect. Somebody else mentioned scroll bars outside of that and along the bottom in their browser, so I tweaked some things.
Yes – I'm doing a modified version. Eventually I'll add the list of articles, but I wanted content to appear too.
moves.push(new move());
moves[i-1].pos = temp[i];
if(winO())
moves[i-1].score = 10;
else if(winX())
moves[i-1].score = -10;
else {
var temp2 = temp.filter(function(val) {
return val !== temp[i];
});
return select(temp2, "O")
}
benjamindowns sends brownie points to @jnmorse :sparkles: :thumbsup: :sparkles:
:star: 408 | @jnmorse | http://www.freecodecamp.com/jnmorse
pringon sends brownie points to @benjamindowns :sparkles: :thumbsup: :sparkles:
:star: 214 | @benjamindowns | http://www.freecodecamp.com/benjamindowns
mca62511 sends brownie points to @jnmorse :sparkles: :thumbsup: :sparkles:
:star: 409 | @jnmorse | http://www.freecodecamp.com/jnmorse
Well, Chrome is telling me this in the console,
getCurrentPosition() and watchPosition() are deprecated on insecure origins. To use this feature, you should consider switching your application to a secure origin, such as HTTPS. See https://goo.gl/rStTGz for more details.
But I saw that warning before back when it was working.
mca62511 sends brownie points to @gxenos :sparkles: :thumbsup: :sparkles:
:star: 282 | @gxenos | http://www.freecodecamp.com/gxenos
indeed. strange.
(small tip - add target='_blank
to your links so they open in a new tab.
target="blank"
orballo sends brownie points to @saintpeter :sparkles: :thumbsup: :sparkles:
:star: 2533 | @saintpeter | http://www.freecodecamp.com/saintpeter
gxenos sends brownie points to @mca62511 :sparkles: :thumbsup: :sparkles:
:star: 337 | @mca62511 | http://www.freecodecamp.com/mca62511
fuzyon sends brownie points to @otmeek :sparkles: :thumbsup: :sparkles:
:star: 357 | @otmeek | http://www.freecodecamp.com/otmeek
function myFunction() {
var result = "invalid";
while (result=="invalid")
{
var xoro = prompt("Do you want to play as X or O");
xoro = xoro.toLowerCase();
if (xoro == "x" || xoro == "o") {
document.getElementById("demo").innerHTML =
"You are playing as " + xoro;
result = "valid";
}
else
{
alert("Invalid input");
}
}
function myFunction() {
var result = "invalid";
while (result=="invalid")
{
var xoro = prompt("Do you want to play as X or O");
xoro = xoro.toLowerCase();
if (xoro == "x" || xoro == "o") {
document.getElementById("demo").innerHTML =
"You are playing as " + xoro;
result = "valid";
}
else
{
alert("Invalid input");
}
}
} // ADD THIS
gordondavidescu sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1451 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
true
and false
function myFunction() {
var result = false;
while (result===false)
{
var xoro = prompt("Do you want to play as X or O");
xoro = xoro.toLowerCase();
if (xoro == "x" || xoro == "o") {
document.getElementById("demo").innerHTML =
"You are playing as " + xoro;
result = true;
}
else
{
alert("Invalid input");
}
}
}
}
powerscoding sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 917 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
powerscoding sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: powerscoding already gave wearenotgroot points
@max77p CSS:
#flip {
position: absolute;
transform: rotate(-90deg);
display: inline-block;
bottom: 135px;
left: 155px;
}
.picture {
padding-top: 150px;
position: relative;
}
HTML
<div class="picture">
<img class="img-circle img-responsive" src="http://a5.files.biography.com/image/upload/c_fill,cs_srgb,dpr_1.0,g_face,h_300,q_80,w_300/MTE5NTU2MzE2NjUyOTk2MTA3.jpg" class="art">
<div id="flip">
<h3>Click to slide the panel right</h3>
</div>
</div><!--end of picture-->
(notice that #flip is nested inside .picture now)
max77p sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1452 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
I'm having trouble getting .json sources to work in my code... for example when I stringify a JSON URL, some work, some don't
This does NOT work
var jsonLink = "http://thoughtsoncoding.com/api/1.0/random.json";
$.getJSON(jsonLink, function(json) {
$(".quote-line").html(JSON.stringify(json));
});
This does work
var jsonLink = "http://www.freecodecamp.com/json/cats.json";
$.getJSON(jsonLink, function(json) {
$(".quote-line").html(JSON.stringify(json));
});
Any ideas?
@max77p add this. CSS
.title {
padding-top: 30px;
display: inline-block;
max-width: 70%;
position: absolute;
left: 346px;
top: 0px;
}
and nest .title inside the .picture
<div class="picture">
<img class="img-circle img-responsive" src="http://a5.files.biography.com/image/upload/c_fill,cs_srgb,dpr_1.0,g_face,h_300,q_80,w_300/MTE5NTU2MzE2NjUyOTk2MTA3.jpg" class="art">
<div id="flip">
<h3>Click to slide the panel right</h3>
</div>
<div class="title">
<p class="lead">I'm a <a class="link" target='_blank' href='http://www.freecodecamp.com/map'>self taught</a> web designer, developer, co-founder and entrepreneur based in Finland.
<br> I'm currently part of a small web development
<br> team in an upcoming start-up, building web and
<br> mobile applications.
<br>My passion is to use technology based
<br> solutions, to help solve real world challenges.
<br> Competences:
<br> Languages and Frameworks:
<br> Javascript, HTML5, CSS3, jQuery, Bootstrap3,
<br> Angular.js, Meteor.js.
<br> Tools & expertise:
<br> Git, Responsive Web Design, Agile
<br> Methodologies.</p>
</div>
</div><!--end of picture-->
json
to the html()
function didn't work either
var jsonLink = "http://thoughtsoncoding.com/api/1.0/random.json?callback=?";
$.getJSON(jsonLink, function(json) {
$(".quote-line").html(JSON.stringify(json));
});
.jumbotron p {
margin-bottom: 15px;
font-size: 21px;
font-weight: 200;
float: left;
}
max77p sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:warning: max77p already gave h4r1m4u points
tile
and use jquery to handle onclick event like this$('.tile').on('click', function() {
// your code
});
$('#board div').on("click", function() {
// do something
});
newGame();
$('#board div').on("click", function() {
playerTurn();
});
function playerTurn() {
// do something
}
aaronkazah sends brownie points to @h4r1m4u :sparkles: :thumbsup: :sparkles:
:star: 1453 | @h4r1m4u | http://www.freecodecamp.com/h4r1m4u
max77p sends brownie points to @subalee :sparkles: :thumbsup: :sparkles:
:star: 148 | @subalee | http://www.freecodecamp.com/subalee
:star: 149 | @subalee | http://www.freecodecamp.com/subalee
bohemian83 sends brownie points to @subalee :sparkles: :thumbsup: :sparkles:
player
needs to be global or passed into your playerturn() function
playerTurn()
is called the var player
is not defined.
gordondavidescu sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 922 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
player
variable (I'm not refering to the string "player"). At line 2 define player in the globla scope, var player;
, then at line 5 get rid of the "var" so that you are setting the global variables's value instead player = "z"
player
inside your onclick handler, which is not exists.
var turn = "nope";
var player = "z";
function newGame() {
var result = false;
turn = "player";
gordondavidescu sends brownie points to @subalee and @tvotyakov :sparkles: :thumbsup: :sparkles:
:star: 151 | @subalee | http://www.freecodecamp.com/subalee
:star: 236 | @tvotyakov | http://www.freecodecamp.com/tvotyakov
Hello to all! Can anyone help me? I'm currently working on the "Campers Leaderboard" project. I'm trying to parse data from http://fcctop100.herokuapp.com/api/fccusers/top/recent using jQuery. Here is the code responsible for this part:
var fccUsersData = [];
$.getJSON("http://fcctop100.herokuapp.com/api/fccusers/top/recent", parseCampersData);
function parseCampersData(campersData){
for (var i = 0; i < campersData.length; i++){
fccUsersData.push({
camperId: i+1,
camperName: campersData[i].username,
camperPointsLast30Days: campersData[i].recent,
camperPointsTotal: campersData[i].alltime
});
}
}
But it doesn't work. No result at all. What am I doing wrong? Here is link to my project on CodePen: http://codepen.io/skosterin88/pen/LGawaK
fccUsersData
array to be filled with the data which I then will display in my app using ReactJS.
rtl
for the .visor
class, which is a parent of your .operation
div
console.log(fccUsersData);
at the end of your parseCampersData()
function and you'll see it's all there. The issue you're having is an asynchronous one. I don't know anything about react, so I'm not sure I can help much as I'm not sure how they handle that. There may be a react method that you should use instead of jQuery's $.getJSON()
.visor {
margin: 10px;
height: 80px;
width: 290px;
background-color: #F0F2EB;
font-size: 34px;
line-height: 80px;
text-align: right;
padding: 0 10px;
vertical-Align: middle;
overflow: auto;
overflow-y: hidden;
direction:rtl;
}
direction: rtl;
julianasobreira sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 923 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
rtl
is a bit strange in it's behavior, so if that effect ends up being something you need I recommend doing it your self by manipulating the array/string in question.
var countdown = {
timer: new Date(0),
showMin: function() {
return addZero(countdown.timer.getMinutes());
},
showSec: function() {
return addZero(countdown.timer.getSeconds());
},
set: function(minutes) {
this.timer.setTime(minutes * 60 * 1000);
console.log("Time set: " + countdown.timer);
},
start: function() {
setInterval(function() {
countdown.timer.setTime(countdown.timer.getTime() - 1000);
}, 100);
},
stop: function() {
clearInterval(countdown.start);
}
};
julianasobreira sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:warning: julianasobreira already gave mattyamamoto points
a
and a method? It's hard to comment without seeing what you did. I think you could just create another propert on your countdown object, timerID, and initialize it to 0 or something. then in your start method you could just start: function() {
coundown.timerID = setInterval(function() {
countdown.timer.setTime(countdown.timer.getTime() - 1000);
}, 100);
},
stop: function() {
clearInterval(countdown.timerID);
}
cpheimbach sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 924 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
This an inline `<paste code here>
` code formatting with a single backtick(`) at start and end around the code
.
```js ⇦ Type 3 backticks and then press [shift + enter ⏎]
(type js or html or css)
<paste your code here>,
then press [shift + enter ⏎]
``` ⇦ Type 3 backticks, then press [enter ⏎]
See also: ☛ How to type Backticks | ☯ Compose Mode | ❄ Gitter Formatting Basics
$(document).ready(function() {
if (navigator.geolocation) {
navigator.geolocation.getCurrentPosition(function(position) {
var lat = position.coords.latitude;
var lon = position.coords.longitude;
lat.toString();
lon.toString();
var location = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon;
$getJSON(location, function(json) {
$(".city").html();
});
});
}
});
narkeeta sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star: 924 | @wearenotgroot | http://www.freecodecamp.com/wearenotgroot
var location = "api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon +"=a8da1aa951cdecc4c121db10e2455ffd";
$getJSON(location, function(json) {
$(".city").html();
$console.log(json)
});
narkeeta sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:warning: narkeeta already gave wearenotgroot points
var location = "http://api.openweathermap.org/data/2.5/weather?lat=" + lat + "&lon=" + lon +"&appid=a8da1aa951cdecc4c121db10e2455ffd";
$getJSON(location, function(json) {
//$(".city").html();
$console.log(json)
Okay I fixed my code a little and im still getting a console message of getJSON not defined
mncode sends brownie points to @maakux :sparkles: :thumbsup: :sparkles:
:star: 62 | @maakux | http://www.freecodecamp.com/maakux
function binaryAgent(str) {
newArr = [];
var arr = str.split(" ");
//console.log(arr);
for (i = 0; i < arr.length; i++) {
console.log(String.fromCharCode(arr[i]));
newArr.push(String.fromCharCode(arr[i]));
// console.log(newArr);
}
str2 = newArr.join(" ");
return str2;
}
binaryAgent("01000001 01110010 01100101 01101110 00100111 01110100 00100000 01100010 01101111 01101110 01100110 01101001 01110010 01100101 01110011 00100000 01100110 01110101 01101110 00100001 00111111");
what to do with that
function cycle() {
for (var i = 0; i <= sequences.length; i++) {
// animation here
// maybe a brief pause here
}
}
var a = 1;
function cycle() {
for (var i = 0; i <= sequences.length; i++) {
lightUp(sequences[i]);
// sleep
}
}
setInterval
and setTimeout
.
for (var sequence in sequences) {
var timer = setInterval(function(sequence) {
sequence.lightUp(); // call to run the animation
}, 1000)(sequence); // 1000ms = 1 second
clearInterval(timer); // next
}
<form class="form-control">
<input type="text" placeholder="cat photo URL" required>
</form>
<button class="btn btn-primary">
<button type="submit">Submit <i class="fa fa-paper-plane"></i></button>
</button>
</form>
</div>
Give the submit button in your form the classes btn btn-primary.
Give the text input in your form the class form-control.
These task are still unchecked, what did I do wrong?
var unit = "C"
$("#unit").on("click", function(){
if (unit == "C") {
unit = "F"
};
if (unit == "F") {
unit = "C"
};
});
var temp = 0;
if (unit == "C") {
temp = json.main.temp - 274.1504;
temp = temp.toString().substring(0,4);
}
if (unit == "F") {
temp = json.main.temp - 255.928;
temp = temp.toString().substring(0,4);
}
$(".temp").html(temp + " " + unit);
@narkeeta unit will bee always "C" here
if (unit == "C") {
unit = "F"
};
if (unit == "F") {
unit = "C"
};
regardless of it equal "C" or "F" in the begining.
unit = unit == 'C' ? 'F' : 'C'
if (unit == "C") {
unit = "F"
};
if (unit == "F") {
unit = "C"
};
var unit = "C";
$("#unit").on("click", function(){
unit = unit == 'C' ? 'F' : 'C';
});
var temp = 0;
if (unit == "C") {
temp = json.main.temp - 274.1504;
temp = temp.toString().substring(0,4);
}
if (unit == "F") {
temp = json.main.temp - 255.928;
temp = temp.toString().substring(0,4);
}
$(".temp").html(temp + " " + unit);
});
narkeeta sends brownie points to @githesp :sparkles: :thumbsup: :sparkles:
:star: 355 | @githesp | http://www.freecodecamp.com/githesp