.col-md-4 {
padding-left: 0;
}
col-md-4
of the surrounding <div id=“sefiebox” class=“col-md-4”>…
has a left and right padding of 15px;
A better solution is to make selfiebox a class set padding-left: 0;
like this:
<div class=“col-md-4 selfiebox”>…</div>
CSS:
.sefliebox {
padding-left: 0;
}
danjp2016 sends brownie points to @mot01 :sparkles: :thumbsup: :sparkles:
:cookie: 439 | @mot01 |http://www.freecodecamp.com/mot01
@joshfilippi it works for me
Objectbase: "stations"clouds: Objectcod: 200coord: Objectdt: 1482890640id: 1851632main: Objectname: "Shuzenji"sys: Objectvisibility: 10000weather: Array[1]wind: Objectproto: Object
joshfilippi sends brownie points to @manish-giri :sparkles: :thumbsup: :sparkles:
:star2: 3337 | @manish-giri |http://www.freecodecamp.com/manish-giri
The parent element container must have position: relative, and navbar must have position: absolute and class .navbar-fixed-top or bottom
joshfilippi sends brownie points to @aboorde :sparkles: :thumbsup: :sparkles:
:cookie: 406 | @aboorde |http://www.freecodecamp.com/aboorde
function Parent(){
$(this) // outer this keyword
function Child(){
$(this) // inner this keyword
}
}
I want to access the Parent "this" keyword in the childfunction Parent(){
var $that = $(this); // outer this keyword assigned to that var
function Child(){
$(this) // inner this keyword
$(that) // outer this keyword
}
}
Hey All! random question... I've just reached the first front end challenge in which you build a Tribute page (the one in which the example is the tribute page for Dr. Norman Borlaug). I think I've built mine to satisfy the User Stories, but I've done it with CSS (I think -- I used a <style></style> section).
Am I allowed to do this?
pmsturgeon sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:star2: 1011 | @sorinr |http://www.freecodecamp.com/sorinr
Child
function use $that
instead of $(that)
, else you will get an error since that
is not defined
// Setup
function abTest(a, b) {
// Only change code below this line
if (a>0, b>0){
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}else{
return undefined;
}
// Only change code above this line
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}
// Change values below to test your code
abTest(-2,2);
ERROR???
if (a>0, b>0)
if (a>0 && b>0)
:cookie: 467 | @oppiniated |http://www.freecodecamp.com/oppiniated
pankajkaushik78 sends brownie points to @oppiniated :sparkles: :thumbsup: :sparkles:
You can change
if (a>0, b>0){
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}else{
return undefined;
}
to if(a<0 && b <0) return undefined
if (a>0 && b>0){
return Math.round(Math.pow(Math.sqrt(a) + Math.sqrt(b), 2));
}
// Nested object which I want to access
quotes = [
{ quote:..., author:..., id:...},{quote..., author:..., id:...},...]
var randomID = Math.floor(Math.random()*26)+1;
// generate a random quote and display in quote-area
var output = document.getElementById('quote-area');
// quote-area is <div> in which the quote should be displayed
// rQFunction gets called when pressing the button
function rQFunction(randomID){
var quote = quotes[randomID].quote;
var author = quotes[randomID].author;
output.innerHTML = quote + "- " + author;
}
Doesn't work. :/ I am more interested in finding conceptual mistakes why this doesn't work. Maybe it's also only something really small. :/
what am i doing wrong? I get an error.
function translatePigLatin(str) {
var vowels = ["a", "e", "o", "i", "u"];
str = str.split("");
if(vowels.indexOf(str[0])!==-1){
str.push("way");
}
while(vowels.indexOf(str[0])==-1){
str.push(str[0]);
str = str.substr(1);
}
return str.join("");
}
translatePigLatin("glove");
ksc23 sends brownie points to @troutman21 :sparkles: :thumbsup: :sparkles:
:cookie: 120 | @troutman21 |http://www.freecodecamp.com/troutman21
the first h3 line in my pens about section is not showing what am i doing wrong httpscodepenioibantonpengnlpjj
needed
"Sitting-Room"
and change the rel also two words is making error
HTML -
<div class="container-fluid text-center">
<h1>Random Quote Generator</h1>
<!-- <p>Some of the quotes are here</p> -->
<div class="img"><img src="http://cdn.arstechnica.net/wp-content/uploads/2016/02/5718897981_10faa45ac3_b-640x624.jpg"></div>
<br />
<button class="btn btn-default" type="submit" id="newQuote">New Quote</button>
<a class="btn btn-default"
href="#" id="tweet" data-size="large">Tweet It!</a>
<div class="quotes text-center">
<span class="quote"></span>
<span class="author"></span>
</div>
</div>
JS -
$(document).ready(function() {
getQuote();
var randomQuote
var author;
function getQuote(){
var url = "http://api.forismatic.com/api/1.0/?method=getQuote&lang=en&format=jsonp&jsonp=?";
$.getJSON(url, function(data) {
$(".quote").html("'" + data.quoteText + "'");
$(".author").html("- " + data.quoteAuthor);
});
};
$("#tweet").on("click", function() {
window.open("https://twitter.com/intent/tweet?text=" + randomQuote);
});
$("#newQuote").on("click", function() {
getQuote();
});
});
http://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=jsonp&lang=en&jsonp=?
. you r missing the key
nani554 sends brownie points to @walid :sparkles: :thumbsup: :sparkles:
:cookie: 76 | @walid |http://www.freecodecamp.com/walid
<a href="#contact"> Contact </a>
and then where your contact section is, you'd want to assign the id contact to a div container or something within that area
It seems that the ajax doesn't work in my codepen but works fine in normal html file
Anyone know what's the problem?
livonian-router sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1209 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
navigator.geolocation
requires HTTPS, but you're trying to call the API over HTTP. Use All HTTPS when possible. There are some errors in the browser's dev console that will give a hint to this. Press Ctrl+Shift+J to see the errors and debug further.
livonian-router sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: livonian-router already gave tylermoeller points
ayvlis sends brownie points to @ankit-prgmr :sparkles: :thumbsup: :sparkles:
:cookie: 245 | @ankit-prgmr |http://www.freecodecamp.com/ankit-prgmr
Here is my code:
```var colors = ["rgba(86,175,99,0.6)", "rgba(86,175,222,0.6)", "rgba(0,0,0,0.6)"];
$(document).ready(function() {
// Click Event Handler
$("#getmessage").click(function() {
// Data Extraction Using Ajax
$.ajax({
url: "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1callback=?",
type: "GET",
datatype: 'json',
success:function(data){
$(".message").html(JSON.stringify(data[0].content));
},
error:function(){
alert("error");
}
});
// Color Generator
var randomColor = colors[Math.floor(Math.random() * colors.length)];
$("body").css({
"background": randomColor,
"transition": "all 2s ease"
});
});
});
var colors = ["rgba(86,175,99,0.6)", "rgba(86,175,222,0.6)", "rgba(0,0,0,0.6)"];
$(document).ready(function() {
// Click Event Handler
$("#getmessage").click(function() {
// Data Extraction Using Ajax
$.ajax({
url: "http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1callback=?",
type: "GET",
datatype: 'json',
success:function(data){
$(".message").html(JSON.stringify(data[0].content));
},
error:function(){
alert("error");
}
});
// Color Generator
var randomColor = colors[Math.floor(Math.random() * colors.length)];
$("body").css({
"background": randomColor,
"transition": "all 2s ease"
});
});
});
cache: false
- see the second code example here: https://quotesondesign.com/api-v4-0/
mcmaster-99 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1212 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
@emamador Calling a setTimeout in a for() loop usually doesn't work unless you make it an immediately-evoked function expression, implement promises, or use some sort of callback counting mechanism. For example, try this code as a simplified version of yours:
for(var i = 10; i >= 0; i--) {
setTimeout(function() {
console.log(i);
}, 1000)
}
This does not count down from 10 to 0, instead you get -1 output 11 times. This Stack Overflow question may help explain in more detail: http://stackoverflow.com/questions/5226285/settimeout-in-for-loop-does-not-print-consecutive-values
emamador sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1213 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
i have a dought, might be a silly one, but it's making me curious!
Below is the link of my code in codepen.
First preview it in full-size, and then just add row
in the class of div
tag (in line-11 of the html code) which would be <div class=" row well well-lg">
. Now notice the changes that takes place
..So i am curious to know that what css property of .div
class made that possible
i wasted and hour in digging and finding out but failed.. if anyone can help me out then i will really appreciate it
http://codepen.io/neel111/pen/dOBjOj?editors=1000
And also it seems fine(with .row class) in small and extra-small size view as if the .row
class is already being added
Guys, I need some help. Why is flexbox not vertically centering my elements? If I specify my body with height: 1000px
it works, but using 100% does not.
https://paulotokimatu.github.io/simon.html
https://paulotokimatu.github.io/simon.css
sziko sends brownie points to @moi238 :sparkles: :thumbsup: :sparkles:
:cookie: 226 | @moi238 |http://www.freecodecamp.com/moi238
<li>
element is clickable with the link of the <a>
tag within it http://codepen.io/mixu1308/pen/oYxPQO
a {
display: block;
}
"<a href=" + data[3][i] + "><h6>" + data[1][i] + "</h6><li><p>" + data[2][i] + "</p></li></a>"
I've tried it but it screws up the whole styling
:warning: Theuser
instance is not valid. Details:username
is not unique (value: "sk22");username
User already exists (value: "sk22").
mixu1308 sends brownie points to @sk22 :sparkles: :thumbsup: :sparkles:
mixu1308 sends brownie points to @sk22 :sparkles: :thumbsup: :sparkles:
:warning: Theuser
instance is not valid. Details:username
User already exists (value: "sk22");username
is not unique (value: "sk22").
float
or display
css properties to modify them. To resize it, use display: inline-block
in your .clear class.
@dwquach First error is that the first line should have parentheses around document
:
$(document).ready(function() {
Second error is that you need an API key for the quote api you have chosen
{"message":"Missing Mashape application key. Go to http:\/\/docs.mashape.com\/api-keys to learn how to get your API application key."}
headers:
not beforesend:
dwquach sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:star2: 1214 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
beforesend
to beforeSend
(note the capital 'S')
console.log(json)
to the first line of your success function and you'll see the quote text logged to the console
dwquach sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: dwquach already gave tylermoeller points
:star2: 1215 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
idahogurl sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
Can someone please help me on Increment a Number with JavaScript? Here is my code:
var myVar = 87;
// Only change code below this line
myVar = myVar++ + 1;
Here is the link: https://www.freecodecamp.com/challenges/increment-a-number-with-javascript