vertical-align:middle
to all icons, they're at least vertically centered
padding-left:0
to the fa-github
class it should be fine - don't know why that happens though
kikykindagirl sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 492 | @taltmann42 |http://www.freecodecamp.com/taltmann42
aaronedwarda sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 495 | @taltmann42 |http://www.freecodecamp.com/taltmann42
playRound
or something you can keep track of the progress from the user which reflects the index of the array of correct colors
basically something like
var currentRound = [3,2,4,4,1];
var currentStep = 0;
then listen on the clicks on the game and check if the color clicked is the one at currentRound[currentStep]
if($(‘#x’).data(‘clicked’)
a good method for that?
$("#x").on("click", function(){ //check if clickable, if yes check if correct or not });
data
you'd have to add the clicked
data anyways when the user clicks on a field, which would also be done with a click event listener
aaronedwarda sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:warning: aaronedwarda already gave taltmann42 points
skycoder01 sends brownie points to @mot01 and @aaronedwarda :sparkles: :thumbsup: :sparkles:
:cookie: 308 | @aaronedwarda |http://www.freecodecamp.com/aaronedwarda
:cookie: 509 | @mot01 |http://www.freecodecamp.com/mot01
aaronedwarda sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 510 | @mot01 |http://www.freecodecamp.com/mot01
mot01 sends brownie points to @aaronedwarda :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @aaronedwarda |http://www.freecodecamp.com/aaronedwarda
@Athabasco from the API documentation: (https://www.mediawiki.org/wiki/API:Main_page)
When you make HTTP requests to the MediaWiki web service API, be sure to specify a User-Agent header that properly identifies your client. Don't use the default User-Agent provided by your client library, but make up a custom header that identifies your script or service and provides some type of means of contacting you
Probably that's the problem
Hey, can someone help me find out why my twitch page is saying they're all playing league of legends when only one of them is? I can't seem to figure it out.
// Using jQuery
$.ajax( {
url: remoteUrlWithOrigin,
data: queryData,
dataType: 'json',
type: 'POST',
headers: { 'Api-User-Agent': 'Example/1.0' },
success: function(data) {
// do something with data
}
} );
athabasco sends brownie points to @mot01 and @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 511 | @mot01 |http://www.freecodecamp.com/mot01
:cookie: 497 | @taltmann42 |http://www.freecodecamp.com/taltmann42
rallph sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 512 | @mot01 |http://www.freecodecamp.com/mot01
list.forEach(function(user, i) {
rallph sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 183 | @skycoder01 |http://www.freecodecamp.com/skycoder01
isabellaliu77 sends brownie points to @joshbivens :sparkles: :thumbsup: :sparkles:
:cookie: 361 | @joshbivens |http://www.freecodecamp.com/joshbivens
var myString = 'hello'
var arrayOfCharacters = myString.split('');
console.log(arrayOfCharacters); // ['h', 'e', 'l', 'l', 'o']
@GoingAllTheWayUp
''
var myString = 'hello'
var arrayOfCharacters = myString.split('', 3);
console.log(arrayOfCharacters); // ['h', 'e', 'l']
var myString = 'hello'
var arrayOfCharacters = myString.split();
console.log(arrayOfCharacters); // ['hello']
''
arrayOfCharacters
var myString = 'hello'
var arrayOfCharacters = myString.split('', 3);
console.log(arrayOfCharacters[0]); // "h"
goingallthewayup sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 188 | @skycoder01 |http://www.freecodecamp.com/skycoder01
adventurebear sends brownie points to @skycoder01 :sparkles: :thumbsup: :sparkles:
:cookie: 189 | @skycoder01 |http://www.freecodecamp.com/skycoder01
.green-box {
background-color: green;
padding: 40px, 20px, 20px, 40px;
}
can anyone help me to find out why it is not working in code pen.But it working fine when i used xampp server.challenge:random quote
JS code:
document.getElementById("btn").addEventListener("click",function(){
var counter=Math.floor(Math.random()10);
var ourRequest=new XMLHttpRequest();
//ourRequest.withCredentials = false;
ourRequest.open('GET','http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]='+counter+'&callback=');
ourRequest.onload=function(){
var ourData=JSON.parse(ourRequest.responseText);
console.log(ourData[0]);
/var t=[];
t=(ourData[0].content).split('');
t.html();
alert(t);*/
}
ourRequest.send();
});
HTML Code:
<button id="btn">Quote</button>
viorelfoamete sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1173 | @sorinr |http://www.freecodecamp.com/sorinr
lawanu sends brownie points to @labiej :sparkles: :thumbsup: :sparkles:
:cookie: 456 | @labiej |http://www.freecodecamp.com/labiej
Guys, whenever I have to make a form with some label and input to be placed next to each other, they never are vertically aligned. Code:
<form class="range-form">
<label class="range-label" for="range-selector">Shadow scale: </label>
<input type="range" id="range-selector" min="10" max="80" value="40">
</form>
The input is always a little towards the top. Why is this? I searched online and found a solution using tables.
@UsamaHameed you can use this:
.range-form {
display: flex;
align-items: center;
position: absolute;
top: 0;
right: 0;
}
to get what you want
usamahameed sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1174 | @sorinr |http://www.freecodecamp.com/sorinr
ng-app
?
c0d0er sends brownie points to @toianw :sparkles: :thumbsup: :sparkles:
:cookie: 493 | @toianw |http://www.freecodecamp.com/toianw
ng-app
ng-controller=""
which caused errors
alant90 sends brownie points to @oppiniated :sparkles: :thumbsup: :sparkles:
:cookie: 567 | @oppiniated |http://www.freecodecamp.com/oppiniated
update
.enter()
.append("circle")
.attr("r", 5)
.attr("cx", function(d) {return xScale(new Date(d.CreationDateTime).getTime()); })
.attr("cy", height)
.style('fill', '#fff')
.style('fill-opacity', .2)
.style('stroke', 'black')
.style('stroke-width', 2);
johnnydemol sends brownie points to @mindwhys :sparkles: :thumbsup: :sparkles:
:cookie: 270 | @mindwhys |http://www.freecodecamp.com/mindwhys
boredgamerz sends brownie points to @mindwhys :sparkles: :thumbsup: :sparkles:
:cookie: 271 | @mindwhys |http://www.freecodecamp.com/mindwhys
viorelfoamete sends brownie points to @mindwhys :sparkles: :thumbsup: :sparkles:
:cookie: 272 | @mindwhys |http://www.freecodecamp.com/mindwhys
<style>
body {
font-family: Monospace;
background-color: green;
}
</style>
<h1>Hello World</h1>
.btn {
cursor: pointer;
}
evandcp sends brownie points to @bd1887 :sparkles: :thumbsup: :sparkles:
:cookie: 338 | @bd1887 |http://www.freecodecamp.com/bd1887
#calculator {
background-color: gray;
width: 250px;
padding-top: 20px;
padding-bottom: 30px;
border-top-left-radius: 2em;
border-top-right-radius: 2em;
margin-right: auto;
margin-left: auto;
}
lorrie01 sends brownie points to @mindwhys :sparkles: :thumbsup: :sparkles:
:cookie: 273 | @mindwhys |http://www.freecodecamp.com/mindwhys
.prev, .next {
cursor: pointer;
position: absolute;
width: auto;
margin-top:45vh;
padding: 16px;
color: white !important;
font-weight: bold;
font-size: 20px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
}
pettar94 sends brownie points to @mindwhys :sparkles: :thumbsup: :sparkles:
:cookie: 274 | @mindwhys |http://www.freecodecamp.com/mindwhys
mindwhys sends brownie points to @pettar94 :sparkles: :thumbsup: :sparkles:
:cookie: 2 | @pettar94 |http://www.freecodecamp.com/pettar94
wisekodama sends brownie points to @bd1887 :sparkles: :thumbsup: :sparkles:
:cookie: 339 | @bd1887 |http://www.freecodecamp.com/bd1887
bd1887 sends brownie points to @formaximus :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for formaximus
formaximus sends brownie points to @bd1887 :sparkles: :thumbsup: :sparkles:
:cookie: 340 | @bd1887 |http://www.freecodecamp.com/bd1887
achudoz sends brownie points to @freakishlancer :sparkles: :thumbsup: :sparkles:
:cookie: 373 | @freakishlancer |http://www.freecodecamp.com/freakishlancer
@WiseKodama In that case,
svg {
width: 20%;
}
This does seem to be changing the size relative to the container that they're in. Your rows and columns aren't doing anything because you aren't using bootstrap. You need to go to "Settings", "CSS", "Add External CSS" and copy and paste this link:
https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css
@EvanDCP yeah, I just created
.button-resizer {
padding: 5px;
}
added it to the approriate buttons and it looks great
evandcp sends brownie points to @achudoz :sparkles: :thumbsup: :sparkles:
:cookie: 264 | @achudoz |http://www.freecodecamp.com/achudoz
Hi, guys!
In my project I’m using google fonts:
In html:
<link href='http://fonts.googleapis.com/css?family=Open+Sans&subset=latin,latin-ext' rel='stylesheet' type='text/css'>
In css:
.navbar-nav {
font-family: 'Open Sans', sans-serif;
margin: 35px 0; /* tob & bottom, right & left */
}
But I want to use Open Sans Extra Bold. It is listed on Open Sans google site here:
https://fonts.google.com/specimen/Open+Sans?selection.family=Open+Sans
How can I use it (that Open Sans Extra Bold) in my project? What should I type into css?
$.get("http://ipinfo.io/json?callback=JSON_CALLBACK",function(data){
alert(data)
});
I can alert the data... but I dunno how to take the loc out!
callback=?
or just callback=
- I think that it might be looking for a function named JSON_CALLBACK
?
$.get
works - it has an optional success
function, so that must just get called.
callback=
or callback=?
as jsonp request while when you put there a value, it tries to call a javascript function you defined with that name JSON_CALLBACK
gentarozzo sends brownie points to @alpox and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 768 | @alpox |http://www.freecodecamp.com/alpox
:star2: 2472 | @khaduch |http://www.freecodecamp.com/khaduch
//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css
and it works better. Maybe you just discovered that? Because I reloaded your page and it works now?
encodeURI
or similar.
hey all, having trouble with my bootstrap and jquery imports, help?
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://use.fontawesome.com/4c474a4a9c.js"></script>
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="head-container container-fluid">
<div class="outer">
<div class="inner">
<div class="row">
<div class="col-md-4">
<p>this is a test</p>
</div>
<div class="col-md-4">
<p>this is another test</p>
</div>
<div class="col-md-4">
<p>again? really?</p>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
the issue is that the divs show up stacked instead of in columns....
<html>
<head>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="css/main.css">
</head>
<body>
<div class="head-container container-fluid">
<div class="outer">
<div class="inner">
<div class="row">
<div class="col-xs-4">
<p>this is a test</p>
</div>
<div class="col-xs-4">
<p>this is another test</p>
</div>
<div class="col-xs-4">
<p>again? really?</p>
</div>
</div>
</div>
</div>
</div>
<script src="https://code.jquery.com/jquery-2.2.4.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>
var rowNumber = document.getElementsByClassName('wikitable').rows.length;
$('.wikitable tr').length
- it gives 101 if you do console.log($('.wikitable tr').length)
document.getElementsByClassName('wikitable')[0].rows.length
ClassName
returns a collection of elements - even if there's only one
$.getJSON('http://en.wikipedia.org/w/api.php?action=parse&page=AFI\'s_100_Years...100_Movie_Quotes&prop=text&format=json&callback=?', function(json) {
var quotes = new Quotes();
//var rowNumber = document.getElementsByClassName('wikitable')[0].rows.length;
var rowNumber = $('.wikitable tr').length;
console.log(rowNumber);
//$('#quoteText').html(json.parse.text['*']);
$("#quoteText").find("a:not(.references a)").attr("href", function(){ return "http://www.wikipedia.org" + $(this).attr("href");});
});
var quotes = new Quotes();
and do this:$('body').html(JSON.stringify(json.parse.text));
ugh.... this stuff needs repetition to get it right. would someone look to tell me why this isn't working?
here's the html:
<div class="container-fluid" id="nav">
<div class="nav navbar-inverse">
<div class="container-fluid">
<div class="row">
<div class="col-md-3">
<h1 class="nav-element">Writer</h1>
</div>
<div class="col-md-3">
<h1 class="nav-element">Designer</h1>
</div>
<div class="col-md-3">
<h1 class="nav-element">Developer</h1>
</div>
<div class="col-md-2">
<h1 class="nav-element">Manager</h1>
</div>
<div class="col-md-1"><span class="fa fa-bars" id="toggle"></span></div>
</div>
<div class="row">
<div class="col-md-3">
<h1 class="nav-element">Student</h1>
</div>
<div class="col-md-3">
<h1 class="nav-element">Musician</h1>
</div>
<div class="col-md-3">
<h1 class="nav-element">Entrepeneur</h1>
</div>
<div class="col-md-2">
<h1 class="nav-element">Actor</h1>
</div>
<div class="col-md-1">
<h1 id="name">CR</h1>
</div>
</div>
</div>
</div>
</div>
here's the CSS:
.nav {
font-family: "Raleway";
color: #fff;
width: 90%;
position: fixed;
top: 0;
left: 0;
transform: translateX(-90%);
transition: ease-in-out 0.8s;
z-index: 1; }
.nav .nav.toggle {
transform: translateX(0); }
.nav .nav.container {
width: 100%; }
.nav .fa-bars {
font-size: 30pt;
margin-left: 15px;
margin-top: 20px; }
and the obligatory JS. Note Jquery and bootstrap are implemented elsewhere in code.
$('#toggle').on('click',function(){
if(!$('.nav').hasClass('toggle')){
$('.nav').addClass('toggle');
}else{
$('.nav').removeClass('toggle');
}
});
nsoual sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 514 | @mot01 |http://www.freecodecamp.com/mot01
amitp88 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 515 | @mot01 |http://www.freecodecamp.com/mot01
hello :) i have this code for my buttons on my portfolio
<button class="navButton"> <a href="#MyWork">
MyWork
</a>
but when i click the button but its not working unless i click the buttons text, why?
<a><button></a>
like this?
<a href="#MyWork"><button class="navButton">
MyWork
</a>
<button><a></a></button>
<a><button class="navButton">href="#MyWork</button></a>
like this (or opposite) ?
trust20 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 516 | @mot01 |http://www.freecodecamp.com/mot01
<a class="navButton" href="#MyWork">MyWork</a>
@moT01 @SkyCoder01 this did it
furball514 sends brownie points to @mot01 and @skycoder01 and @trust20 and @sorinr and @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 131 | @trust20 |http://www.freecodecamp.com/trust20
:cookie: 190 | @skycoder01 |http://www.freecodecamp.com/skycoder01
:star2: 1175 | @sorinr |http://www.freecodecamp.com/sorinr
:cookie: 502 | @taltmann42 |http://www.freecodecamp.com/taltmann42
:cookie: 517 | @mot01 |http://www.freecodecamp.com/mot01
philiplee15 sends brownie points to @furball514 :sparkles: :thumbsup: :sparkles:
:cookie: 186 | @furball514 |http://www.freecodecamp.com/furball514
I am trying to trigger an array of click events one at a time through my whole array and I am having trouble with something in my function...if anybody can explain to me how to fix It and why . I would be very greatful for any help. :-)
<!--(I added the previous function for reference)
function sequence (){
simon.push(theoptions[Math.floor (Math.random ()*4 )]);
blinkerBeats (); } -->
function blinkerBeats(){
var says= setInterval(function(){
if (var i=0,i>=simon.length,i++){
$(simon[i]).click();
clearInterval(says);
}
}
,1000);
blankStatePlayer ();
}
i>= simon.length
? probably you want to use i < simon.length
. Also, you clear the interval every time in the loop. It works but it's unnecessary, you can either do that after the loop, or use setTimeout
which only fires once
rebecca-acceber sends brownie points to @taltmann42 :sparkles: :thumbsup: :sparkles:
:cookie: 503 | @taltmann42 |http://www.freecodecamp.com/taltmann42
i*1000
that fires the first immediately because 0*1000
= 0, the next after 1 second and so on. But in the for-loop you should probably call a function with i
as parameter which then creates the timeout. Otherwise, by the time the timeout fires, the loop has already finished and i
will refer to the last index of the simon-array
ptrbates sends brownie points to @codemycoffee :sparkles: :thumbsup: :sparkles:
:cookie: 279 | @codemycoffee |http://www.freecodecamp.com/codemycoffee
class="text-left"
gratianl sends brownie points to @ptrbates :sparkles: :thumbsup: :sparkles:
:cookie: 119 | @ptrbates |http://www.freecodecamp.com/ptrbates
ptrbates sends brownie points to @jfc246 :sparkles: :thumbsup: :sparkles:
:cookie: 229 | @jfc246 |http://www.freecodecamp.com/jfc246
ptrbates sends brownie points to @jfc246 :sparkles: :thumbsup: :sparkles:
:warning: ptrbates already gave jfc246 points
var a = 5;
function () {
var b = 10;
// a here = 5
//b here = 10
}
//a here = 5
//b here = undefined
// Declare your variable here
function fun1() {
// Assign 5 to oopsGlobal Here
}
var myGlobal=10;
// Only change code above this line
function fun2() {
var output = "";
if (typeof myGlobal != "undefined") {
output += "myGlobal: " + myGlobal;
}
if (typeof oopsGlobal != "undefined") {
output += " oopsGlobal: " + oopsGlobal;
}
console.log(output);
contactsArray[firstName][prop];
contacts.firstName.prop;
becuase I want to use space's in my object name/value pairing
$.getJSON("http://ip-api.com/json", function(geoData) {
latitude = String(geoData.lat);
longitude = String(geoData.lon);
});
var urlAlt = "http://api.openweathermap.org/data/2.5/weather?lat="+latitude+"&lon="+longitude+"&units=metric&APPID=b51ffb00809b0c668546058f4937a62d";
$("#about").html(urlAlt);
@DarkoxD this is a quick fix, but you can tweak it as you wish `<div id="calculator">
<div class="calcRow">
<button class="btn btn-danger"><a id="deleteAll">AC</a></button>
<button class="btn btn-danger"><a id="backOne">CE</a></button>
<button class="btn btn-primary"><a id="/">/</a></button>
<a class="btn btn-primary" id="*">*</a>
</div>
<div class="calcRow">
<button class="btn btn-primary"> <a id="7">7</a></button>
<button class="btn btn-primary"><a id="8">8</a></button>
<button class="btn btn-primary"><a id="9">9</a></button>
<button class="btn btn-primary"><a id="-">-</a></button>
</div>
<div class="calcRow">
<button class="btn btn-primary"><a id="4">4</a></button>
<button class="btn btn-primary"><a id="5">5</a></button>
<button class="btn btn-primary"><a id="6">6</a></button>
<button class="btn btn-primary"><a id="+">+</a></button>
</div>
<div class="calcRow">
<button class="btn btn-primary"><a id="1">1</a></button>
<button class="btn btn-primary"><a id="2">2</a></button>
<button class="btn btn-primary"><a id="3">3</a></button>
<button class="btn btn-primary"><a id=".">.</a></button>
</div>
<div class="calcRow">
<button class="btn btn-primary bigButton"><a id="0">0</a></button>
<button class="btn btn-primary bigButton col-md-4"><a id="total">=</a></button>
</div>
</div>
<style>
background-color: gray;
width: 250px;
padding-top: 20px;
padding-bottom: 30px;
padding-left:1em;
padding-right:1em;
border-radius: 0 0 2em 2em;
margin-right: auto;
margin-left: auto;
}
.calcRow{
display:flex;
justify-content:space-around;
}
.btn-primary,btn-danger{
width:20%;
height:inherit;
}
</style>`
$("h1, h2, h3, h4, h5, h6").addClass("text-uppercase");
document.body.style
you have to tell it what to style. Read here for more info: http://www.w3schools.com/jsref/prop_style_background.asp