#results-container{
display:none !important; /// <<< REMOVE !important
}
#results-container.active{ // <<<< fix TYPO `contianer`
display:block;
}
usyyy sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 521 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
buiphuking sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 522 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
usyyy sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 655 | @ndburrus |http://www.freecodecamp.com/ndburrus
holish sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 523 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
holish sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: holish already gave jdtdesigns points
@jdtdesigns, do you have a moment to look at something? I can't seem to get my 'Contact' link to jump to the contact section. This is after a complete rewrite verify everything I could... Thanks in advance if you have the time. Here's the rewrite:
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 524 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
emilypmendez sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 525 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave jdtdesigns points
.row
class after each of those three .containers
in the 'About' section?
.containers
with <div class="row">
?
faeller sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1350 | @khaduch |http://www.freecodecamp.com/khaduch
Ohhhh... Only one container-fluid. Humbled here. Didn't know that. I'll start there getting rid of those containers then look at the inspector.
I had thought that I needed a container for the groups of text + pics in the 'About' section. Your comment now makes sense. They are ALREADY in columns by virtue of having a single container-fluid
class. Makes a lot of sense.
faeller sends brownie points to @holish :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for holish
faeller sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 526 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
section.menu-item
elements have a fixed-width margin of 20px on all sides, so that takes away 80px across the width. if you reduce the width of the elements where you have 50%
to 45%
, then it lays out along the lines of your proposed plan (although the third div is at the same width contraint, so it won't lay out as you've planned.
function diffArray(arr1, arr2) {
var newArr = [];
var newArr2= [];
var newArr3= [];
var newArr4= [];
var indexOfi;
var indexOfj;
// Same, same; but different.
function crop(val){
return val!==arr1[indexOfi];}
function crop2(val){
return val!==arr2[indexOfj];}
var len1=arr1.length;
var len2 =arr2.length;
for(var i=0;i<len1;i++)
{
for(var j=len1;j<len2;j++)
{
if(arr1[i]===arr2[j])
{
indexOfi=arr1.indexOf(arr1[i]);
indexOfj=arr2.indexOf(arr2[j]);
newArr2=newArr2.push(arr1.filter(crop));
newArr3=newArr3.push(arr2.filter(crop2));
}
}
}
newArr4=newArr2.concat(newArr3);
return newArr4;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
error coming that newArr2 is not a function, can anybody help and tell what mistake i have made..
@faeller - I removed the margin, and I also changed the breakpoint that you were using for your wider-width window because you had a max-width on the media query of 991px on it, and then I think you changed to 25% width about 992px?
I don't really understand why, but setting the margin on the elements to 0, the body margin to 0 and leaving the width at 50% does not generate the type of alignment that you want, but changing the width to 49% does generate the alignment that you are looking for on the first two boxes.
newArr2=newArr2.push(arr1.filter(crop));
does not look like the proper way to use .push()
- you would only need to do newArr2.push()
to push the element on that array - no further assignment needed.
containers
like you had suggested. So far, so good -- but still a bit confused. In the 'Contact' section, if there's no new container
, how can I get the social icons into their own "section" so that they're vertical and to the left of the contact form? Thanks in advance. Here's the CodePen: https://codepen.io/andreas2249/full/MejrMG/
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 527 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
newArr2.push(arr1.filter(crop))
, but then assigning that result back to newArr2
would clobber the value in newArr2
, because the returned value from the .push()
is the new length of the array.
shivamsonu29 sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1351 | @khaduch |http://www.freecodecamp.com/khaduch
adventurebear sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 609 | @gregatgit |http://www.freecodecamp.com/gregatgit
function diffArray(arr1, arr2) {
var newArr=[];
var ind=[];
var fArr=[];
newArr=arr1.concat(arr2);
var idx;
function crop(val){
for(var i=0;i<ind.length;i++)
return val!==arr[ind[i]];
}
for(var i=0;i<newArr.length;i++)
{
do
{
idx=newArr.indexOf(newArr[i]);
ind.push(idx);
idx=newArr.indexOf(newArr[i],idx+1);
}while(idx!=-1);
if(ind.length>1)
{
fArr.push(newArr.filter(crop));
}
}
return fArr;
}
diffArray([1, 2, 3, 5], [1, 2, 3, 4, 5]);
infinite loop error is coming, any idea. the error is coming for statement while(idx!=-1)...
img-responsive
if using bootstrap
jubayerevan sends brownie points to @kirbyedy :sparkles: :thumbsup: :sparkles:
:star2: 1133 | @kirbyedy |http://www.freecodecamp.com/kirbyedy
gregatgit sends brownie points to @tony-tosp :sparkles: :thumbsup: :sparkles:
:cookie: 272 | @tony-tosp |http://www.freecodecamp.com/tony-tosp
User Story: I can view a tribute page with an image and text.
User Story: I can click on a link that will take me to an external website with further information on the topic.
@96street just use this simply:
.settingsMenu ul li a:hover {
border-radius: 5px 5px 0 0;
background-color: #666;
}
:cookie: 282 | @tbuglc |http://www.freecodecamp.com/tbuglc
is this better?
for (var i = 0; i < collection.length; i++) {
for ( var key in source ) {
if (collection[i].hasOwnProperty(source[key]));
}
}
@shivamsonu29
for (var i = 0; i < collection.length; i++) {
for ( var key in source ) {
if (collection[i].hasOwnProperty(source[key])); {
}
}
}
var api = "http://ip-api.com/json";
$.getJSON(api, function(json){
console.log(json);
});
doko85 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 610 | @gregatgit |http://www.freecodecamp.com/gregatgit
$(“#buttonclick”).on(“click”, function(……
jaimenunez sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1073 | @dhcodes |http://www.freecodecamp.com/dhcodes
eval()
.but it is not working.please help me.img {
transition: opacity .4s;
}
img:hover {
opacity: 0;
}
urketadic sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1077 | @dhcodes |http://www.freecodecamp.com/dhcodes
vertical-align: top;
to the .one
class.
var link = data._links.self;
and it works. It throws an invalid error.
randallfine sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 540 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
var links = data._links.self || "";
var links = data._links.self || false;
.
melanieleann sends brownie points to @karolinakluz :sparkles: :thumbsup: :sparkles:
:cookie: 319 | @karolinakluz |http://www.freecodecamp.com/karolinakluz
.footer
text? Just set it in .footer {..}
.
Good morning, Campers. Can someone please identify why the link to the 'Contact' section is not going to the top of the 'Contact' page as it does with the 'Portfolio' and 'About' links? (i.e. linking to that page still shows some of the prior page at the top of the screen.)
Here's my CodePen: https://codepen.io/andreas2249/pen/MejrMG Many thanks in advance. :)
doko85 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 528 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
containers
as you had suggested yesterday. Got some improvement.)
andreas2249 sends brownie points to @jdtdesigns and @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 529 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
:cookie: 541 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
<!DOCTYPE html>
<html>
<head>
<style>
*{
margin:0px;
padding:0px;
}
body{
margin:10px 0px;
}
div.outer{
height:400px;
width: 500px;
margin:100px auto;
margin-top: 130px;
background-color:red;
}
div.length1{
height:380px;
width:30px;
margin:10px 470px 10px 0px;
background-color:blue;
}
</style>
</head>
<body>
<div class="outer">
<div class="length1"></div>
<div class="breadth1"></div>
<div class="length2"></div>
<div class="breadth2"></div>
</div>
</body>
</html>
window.setTimeout
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave jdtdesigns points
$("#minutes").text(i);
$("#seconds").text(sec);
window.setTimeout(function() {}, 1000);
<div class="row">
<div class="col-xs-6">
<h1>A Header</h1>
<p>Some paragraph text</p>
</div>
<div class="col-xs-6">
<h1>Another Header</h1>
<p>Some more paragraph text</p>
</div>
</div>
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave jdtdesigns points
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave jdtdesigns points
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave jdtdesigns points
sorinr sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 542 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
roniquericketts sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 530 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
$('#allChan').prepend(<a href='url'><li><img src='" + data2.logo + "'/>+ some text </li></a>);
$('#allChan').prepend(
'<a href="' + url + '">' +
'<li><img src="' + data2.logo + '">Some Text</li>' +
'</a>'
);
roniquericketts sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: roniquericketts already gave jdtdesigns points
adventurebear sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1143 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
srishti-learner sends brownie points to @wearenotgroot :sparkles: :thumbsup: :sparkles:
:star2: 1144 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
color:colors[clr]
with lowercase
Hello! I’m beginning to learn html 5 now. I keep getting an error message that says “expected script to have an attribute src” Here are my link and script tags: ```js
<link rel="stylesheet" href="style.css">
<script src="script.css"></script>
```
<link rel="stylesheet" href="style.css">
<script src="script.css"></script>
ampang sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 543 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
<link rel="stylesheet" href="style.js">
<script src="script.js"></script>
<link rel="stylesheet" href="style.css">
<script src="script.js"></script>
srishti-learner sends brownie points to @greg :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for greg
Hi, I'm CamperBot! I can help you in this chatroom :smile:
find TOPIC
find all entries about topic. e.g. find js
wiki TOPIC
show contents of topic pagethanks @username
send brownie points to another userabout @username
shows info on that userAlgorithm BONFIRENAME
info on a Algorithm:star2: 1144 | @wearenotgroot |http://www.freecodecamp.com/wearenotgroot
@jdtdesigns or @hiltydiggs, I've placed myself in self-imposed "container vs. row" school... :)
I was instructed earlier: "Go through and make sure all of your content is placed correctly inside of rows/columns. The columns inside a row should always equal to 12 , no matter how much you have in the column."
So does that mean if I want to put another section of content below the 'Row 1' and 'Row 2' boxes (which are 4 columns each), I should put an "empty" div
of 4 columns to the right of the 'Row 2' box so that total count in row = 12? Here's my sandbox: http://codepen.io/andreas2249/pen/VjKqVo?editors=1100
.row
and .col-xx-4
should not be on the same element.
andreas2249 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 544 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
<button class="btn btn-default target1"></button>
<button class="btn btn-default target1" id="your-id-name"></button>
i
into your callback properly (otherwise it will always be the last value, returning undefined)
<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default" id="target1"></button>
<button class="btn btn-default" id="target2"></button>
<button class="btn btn-default" id="target3"></button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default" id="target4"></button>
<button class="btn btn-default" id="target5"></button>
<button class="btn btn-default" id="target6"></button>
</div>
</div>
</div>
</div>
ethana99 sends brownie points to @roniquericketts and @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 545 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
:cookie: 299 | @roniquericketts |http://www.freecodecamp.com/roniquericketts
roniquericketts sends brownie points to @hiltydiggs and @sannek :sparkles: :thumbsup: :sparkles:
:cookie: 424 | @sannek |http://www.freecodecamp.com/sannek
:cookie: 546 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
.background {transition: background-color 2s;}
lukenetti3 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 547 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
lukenetti3 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:warning: lukenetti3 already gave hiltydiggs points
display: inline-block;
to ul it works.
float
instead of loat
anders-rydholm sends brownie points to @hiltydiggs and @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 548 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
:cookie: 613 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
$( "*" ).click(function(){
this.blur();
});
-webkit-tap-highlight-color: rgba(255, 255, 255, 0);
:cookie: 614 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
manu-4216 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
manu-4216 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 549 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
.container
class in a page. On StackOverflow, mixed opinions on using multiple containers (everyone does agree to never nest them). Bootstrap's own websites do use multiple containers. What's your opinion and practice? Single or multiples? Thanks in advance.
andreas2249 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 550 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
* {
border: 1px solid black;
}
andreas2249 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave hiltydiggs points
finkbeca sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 615 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
<p><q><span" + quote.content + "</q></p>
If you are a user of sublime text (I hope you are, it kicks ass. You can get it here), then you may have already noticed some of the tab completion capabilities. For example, when you are opening an html tag such as <p>
, it automatically closes the tag as soon as you type /
. You can get similar functionality for pieces of code you end up re-writing over and over, and it's surprisingly easy!
Here's an example, which activates after typing div
and then tab:
:pencil: read more about adding snippets to sublime text on the FCC Wiki
lukenetti3 sends brownie points to @tylermoeller and @hiltydiggs :sparkles: :thumbsup: :sparkles:
:warning: lukenetti3 already gave hiltydiggs points
:cookie: 616 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
function lookUpProfile(firstName, prop){
// Only change code below this line
var entry = 0;
var record = "";
var result = "";
while (entry < contacts.length) {
if (firstName !== contacts[entry].firstName) {
if (entry === contacts.length) {
return "No such contact";
}
else {
entry++;
}
}
else if (firstName === contacts[entry].firstName) {
if (prop !== contacts[entry][prop]) {
return "No such property";
}
else if (prop === contacts[entry][prop]) {
result = contacts[entry][prop];
return result;
}
}
}
// Only change code above this line
}
// Change these values to test your function
lookUpProfile("Akira", "likes");
$quotes.html("<p>\"<span>" + quote.content + "</span>\"</p>" + '<b>' + '<p style="color:grey">' + '- ' + quote.title + '</p>');
and .quote p {display: inline;}
work
$quotes.html("<p>"<span>" + quote.content + "</span>"</p>" + '<b>' + '<p style="color:grey">' + '- ' + quote.title + '</p>');
finkbeca sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: finkbeca already gave tylermoeller points
:warning: finkbeca already gave tylermoeller points
finkbeca sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
function lookUpProfile(firstName, prop){
// Only change code below this line
var entry = 0;
var record = "";
var result = "";
while (entry < contacts.length) {
if (firstName !== contacts[entry].firstName) {
if (entry === contacts.length) {
return "No such contact";
}
else {
entry++;
}
}
else if (firstName === contacts[entry].firstName) {
if (prop !== contacts[entry][prop]) {
return "No such property";
}
else if (prop === contacts[entry][prop]) {
result = contacts[entry][prop];
return result;
}
}
}
// Only change code above this line
}
// Change these values to test your function
lookUpProfile("Akira", "likes");
<br />
would work.
$quotes.html('<p>"<span>' + quote.content + '</span>"</p>' + '<br /><b><p style="color:grey">' + '- ' + quote.title + '</b></p>');
lukenetti3 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 551 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
.image {
width: 100%;
max-width: 250px;
}
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
function LookUp(name , prop){
var items = contacts.filter(function(item){
if(item.firstName === name ){
return item;
}
});
if(item.length){
return item[0][prop];
}
}
//Setup
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
function LookUp(name , prop){
var items = contacts.filter(function(item){
if(item.firstName === name ){
return item;
}
});
if(item.length){
return item[0][prop];
}
}
finkbeca sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: finkbeca already gave tylermoeller points
beingds sends brownie points to @besara :sparkles: :thumbsup: :sparkles:
:cookie: 201 | @besara |http://www.freecodecamp.com/besara
"
just helps avoid errors from escaping characters and creating valid html. Here's a character chart
lukenetti3 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:warning: lukenetti3 already gave hiltydiggs points
// this array of objects
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
// this function to return the object or field in object from contacts array
// @name : search in firstName in array by this params
// @prop : that is what you need function to return from found item it is optional if you dont provide it the entire object will return
function lookUp(name , prop){
var found = null;
// if no name return null
if(!name){
return found;
}
// make filter to array and search for item has fristName == name
// item var it is array
var item = contacts.filter(function(iteminArray){
// if firstname == name return the item in item array
if(iteminArray.firstName === name) {
return iteminArray;
}
});
// if item arary has length then waht you search about it is found
if(item.length){
/*
if(prop ){
found = item[0][prop];
}else{
found = item
}
*/
found = (prop) ? item[0][prop] : item[0];
}
return found;
}
// invoke the function
var xx = lookUp('Akira','likes');
console.log(xx);
// this array of objects
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
function lookUp(name , prop){
var found = null;
if(!name){
return found;
}
var item = contacts.filter(function(iteminArray){
if(iteminArray.firstName === name) {
return iteminArray;
}
});
if(item.length){
/*
if(prop ){
found = item[0][prop];
}else{
found = item
}
*/
found = (prop) ? item[0][prop] : item[0];
}
return found;
}
var xx = lookUp('Akira','likes');
// this array of objects
var contacts = [
{
"firstName": "Akira",
"lastName": "Laine",
"number": "0543236543",
"likes": ["Pizza", "Coding", "Brownie Points"]
},
{
"firstName": "Harry",
"lastName": "Potter",
"number": "0994372684",
"likes": ["Hogwarts", "Magic", "Hagrid"]
},
{
"firstName": "Sherlock",
"lastName": "Holmes",
"number": "0487345643",
"likes": ["Intriguing Cases", "Violin"]
},
{
"firstName": "Kristian",
"lastName": "Vos",
"number": "unknown",
"likes": ["Javascript", "Gaming", "Foxes"]
}
];
function lookUp(name , prop){
var found = null;
if(!name){
return found;
}
var item = contacts.filter(function(iteminArray){
if(iteminArray.firstName === name) {
return iteminArray;
}
});
if(item.length){
/*
if(prop ){
found = item[0][prop];
}else{
found = item
}
*/
found = (prop) ? item[0][prop] : item[0];
}
return found;
}
var xx = lookUp('Akira','likes');
$.each(users, function(i, users){
$.ajax({
type: 'GET',
url: 'https://api.twitch.tv/kraken/users/' + user,
headers: {
'Client-ID': 'qubvi0p9dicv87g9a4s7etay32x6504'
},
success: function(data) {
use response data here...
});
@UgurKurt Old version was a better foundation. You want the wrapper box.
ugurkurt sends brownie points to @carradee :sparkles: :thumbsup: :sparkles:
:cookie: 222 | @carradee |http://www.freecodecamp.com/carradee
Hey, i am kinda done with my quote machine for now, i know it looks terrible in comparison to the example but i need help with media queries
http://codepen.io/urketadic/pen/zBKppa
Basically when i lower the screen, the quote box gets messed up. Can someone give me a hand?
var $users = $('#users');
var users = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
var onlineChannels = [];
var offlineChannels = [];
var url = 'https://api.twitch.tv/kraken/streams/jsonp';
$.each(users, function(index, value){
$.ajax({
type: 'GET',
url: 'https://api.twitch.tv/kraken/users/' + value,
success: function(data) {
console.log(data);
$users.append('<li>name: '+ data.name +', logo: '+ data.logo + '</li>');
}
});
});
@media screen and (max-width: 700px) {
#quote {
margin: 50px 100px 0;
}
}
@media screen and (max-width: 460px) {
#quote {
margin: 50px 20px 0;
}
}
data.logo
returns an image URL, so you'll have to put that into an <img />
element.
urketadic sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 531 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
@jdtdesigns: (a) took out all those extra containers; (b) put myself in a full day's worth of Remedial Container-vs.-Column-vs.-Row school; (c) drank a tall glass of chilled vodka and walked the dog; (d) after all that, found the problem: The .well
at the bottom of the 'About' page (above the 'Contact' page) needed to be inside a row.
After that, everything just fit together and started working. Other stuff I couldn't align before, aligned. CSS that wasn't working, started working. The sun came out. Etc., etc. :)
function whereAreYou(collection, source) {
// What's in a name?
var arr = [];
for ( var i = 0; i < collection.length; i++ ) {
for ( var j = 0; j < source.length; j++ ) {
if ( collection[i].hasOwnProperty(source[j]) ) {
console.log("testing");
}
}
}
/*
var newCollection = Object.keys(collection);
var newSource = Object.values(source);
if (newCollection.hasOwnProperty()) {
console.log("hello");
}
console.log(collection);
console.log(newSource);
*/
// Only change code above this line
return arr;
}
whereAreYou([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
padding-bottom: 600px;
on #main-content
You're a Prince, @jdtdesigns. I did learn about your last suggestion in my study today. Even practiced all day in this Sandbox I created: http://codepen.io/andreas2249/pen/VjKqVo/
You're right, I did notice how awful it starts looking at smaller sizes. Gonna make a copy of what I have before I attempt that.
andreas2249 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 532 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
andreas2249 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 552 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
source[j].last
@hiltydiggs, that 600px was to "push down" the rest of the content to only show the home page image -- the the rest could be scrolled up like a screen to cover that image.
I knew the effect I wanted. Took a shot in the dark that was the way to make it work.
Do you have a better idea on that?
jesse989 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 533 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
min-height: 600px;
@hiltydiggs, oddly enough, changing that padding
to min-height
"breaks" the contact page again, i.e., linking to 'Contact' page shows prior section's content. (That section is cursed!)
To use min-height
, does that mean I just need more content (or space) in that page? If so, how do I add dummy space to accommodate correctly using min-height
?
ammardinho sends brownie points to @doko85 :sparkles: :thumbsup: :sparkles:
:cookie: 397 | @doko85 |http://www.freecodecamp.com/doko85
var testKey = Object.keys(source)[0];
console.log(testKey);
var testValue = source[testKey];
console.log(testValue);
jackedwardlyons sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 553 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
for ( var i = 0; i < collection.length; i++ ) {
if ( collection[i].hasOwnProperty(testValue) ) {
console.log("test");
}
}
var testKeys = Object.keys(source);
as @jdtdesigns said. I'm working through it myself. It's been changed since I did it last.
jackedwardlyons sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:warning: jackedwardlyons already gave hiltydiggs points
function whereAreYou(collection, source) {
// What's in a name?
var arr = [];
var testKey = Object.keys(source)[0];
console.log(testKey);
var testValue = source[testKey];
console.log(testValue);
for ( var i = 0; i < collection.length; i++ ) {
if ( collection[i].hasOwnProperty(testKey) ) {
arr.push(testKey + ": " + testValue);
}
}
return arr;
}
whereAreYou([{ first: "Romeo", last: "Montague" }, { first: "Mercutio", last: null }, { first: "Tybalt", last: "Capulet" }], { last: "Capulet" });
.img-responsive
but it doesn't seem to want to work!
<p>
text stays inside that same div as well (the about div)