swoozeki sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1093 | @mutantspore | http://www.freecodecamp.com/mutantspore
fattone225 sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1094 | @mutantspore | http://www.freecodecamp.com/mutantspore
codingducky sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1095 | @mutantspore | http://www.freecodecamp.com/mutantspore
padding-top: 50px;
to your body tag. but not both html and body
@andrewchar
from the bootstrap site
Body padding required
The fixed navbar will overlay your other content, unless you add padding to the top of the <body>. Try out your own values or use our snippet below. Tip: By default, the navbar is 50px high.
body { padding-top: 50px; }
background-attachment: fixed;
to make the background image fixed in place and scroll to allow it to scroll
<div class="navbar-header">
<a class="navbar-brand color-me" href="#home">Home</a>
.navbar-header .color-me:hover {
color: #0099cc;
}
my solution
About Me
page.
<body>
tag in the HTML panel - CodePen puts the various pieces from the UI into a template. This results in malformed HTML. It might not affect the page display on CodePen, depends on what you are doing. If you look at the frame source from the CodePen view frame, you'll see multiple <body> tags, other things that are flagged in the FireFox view of the source as stray </div>
tags, stray <script>
tags.andrewchar sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star: 488 | @khaduch | http://www.freecodecamp.com/khaduch
khaduch sends brownie points to @calicode :sparkles: :thumbsup: :sparkles:
:star: 324 | @calicode | http://www.freecodecamp.com/calicode
.home-intro {
color: white;
font-family: 'Tillana', cursive !important;
padding: 270px 0;
}
Code New Roman
for anybody curious.
chethanbhat sends brownie points to @shannon-latham :sparkles: :thumbsup: :sparkles:
:star: 381 | @shannon-latham | http://www.freecodecamp.com/shannon-latham
text-center
css class: text-shadow: black 0px 0px 10px;
and see how it looks.
chethanbhat sends brownie points to @shannon-latham :sparkles: :thumbsup: :sparkles:
:warning: chethanbhat already gave shannon-latham points
class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1"
benmhz sends brownie points to @hermanfassett and @hermanfassett :sparkles: :thumbsup: :sparkles:
:star: 1546 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
:star: 1546 | @hermanfassett | http://www.freecodecamp.com/hermanfassett
benmhz sends brownie points to @andrewchar :sparkles: :thumbsup: :sparkles:
:star: 272 | @andrewchar | http://www.freecodecamp.com/andrewchar
$('selector').attr('href', 'URL' + variable);
johnotu sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star: 921 | @qualitymanifest | http://www.freecodecamp.com/qualitymanifest
$('HTMLplaceWhereYouPutYourQuote').attr('href', 'URL' + yourCurrentQuoteVariable);
. you don't have to add in the %20
's in place of spaces, they're added in for you. try playing around with https://twitter.com/intent/tweet?text=
and adding some sentences after it, in your browser
:star: 273 | @andrewchar | http://www.freecodecamp.com/andrewchar
andrewchar sends brownie points to @cannelflow :sparkles: :thumbsup: :sparkles:
:star: 743 | @cannelflow | http://www.freecodecamp.com/cannelflow
mynameissal sends brownie points to @dukbcaaj :sparkles: :thumbsup: :sparkles:
:star: 388 | @dukbcaaj | http://www.freecodecamp.com/dukbcaaj
for( var i in json.query.pages) { etc}
?
$('#1').click(function(){
var num1=$('#1').val();
alert(num1);
});
});
this code does not display value at html location with id="1"
https://jsfiddle.net/himynameissal/dn3ekoos/ Anyone know why my other elements inherit opactiy of #quote-box
. Also, how to center text vertically in a div - I've tried
display: table-cell;
vertical-align: middle;
but this changes the height of my div.
for (var key in json.query.pages) {}
var pages = json.jquery.pages;
for (var i = 0; i < pages.length; i++) {}
Hi everyone, I'm working on the second frontend project. I have a small problem. The new quote button disappears after one click. How do I make it stay?
This is the JS code I have, for now.
function myFunction() {
var quote=document.getElementById("quote");
quote.innerHTML="haha, I changed it!";
}
And this is the button html code
<button class="btn btn-primary btn-lg new-quote" onclick="myFunction()">New quote
</button>
var num1=$('#1').val();
alert(num1);
});
});
this code does not display value in alert box.var num1=$('#1').text();
manojansh sends brownie points to @urobert :sparkles: :thumbsup: :sparkles:
:star: 560 | @urobert | http://www.freecodecamp.com/urobert
manojansh sends brownie points to @urobert :sparkles: :thumbsup: :sparkles:
:warning: manojansh already gave urobert points
tridevguha sends brownie points to @dzsobacsi :sparkles: :thumbsup: :sparkles:
:star: 301 | @dzsobacsi | http://www.freecodecamp.com/dzsobacsi
shkurata sends brownie points to @dzsobacsi :sparkles: :thumbsup: :sparkles:
:star: 302 | @dzsobacsi | http://www.freecodecamp.com/dzsobacsi
tridevguha sends brownie points to @wcat13 :sparkles: :thumbsup: :sparkles:
:star: 270 | @wcat13 | http://www.freecodecamp.com/wcat13
$.getJSON("http://api.openweathermap.org/data/2.5/weather?lat="+ position.coords.latitude +"&lon="+ position.coords.longitude+"&appid=44db6a862fba0b067b1930da0d769e98", function(json) {
var obj = json;
$(".message").html(JSON.stringfy(obj.coord[0]));
msg.payload = {};
msg.payload = msg.data.current_observation.observation_time.replace(" EST",", ")
// + "location: " + msg.data.current_observation.display_location.full + ", "
+ "station: " + msg.data.current_observation.observation_location.full + ", "
+ "temp: " + msg.data.current_observation.temp_f + "°F, "
+ "humidity: " + msg.data.current_observation.relative_humidity + ", "
+ "wind: " + msg.data.current_observation.wind_string;
msg.time = msg.data.current_observation.observation_time;
return msg;
function(data) {
var msg = JSON.parse(data);
console.log(msg)
});
Will that print the data you want?
var c = obj.coord;
$(".message").html(c)
sigursiguros sends brownie points to @wcat13 :sparkles: :thumbsup: :sparkles:
:star: 271 | @wcat13 | http://www.freecodecamp.com/wcat13
$.getJSON("http://api.openweathermap.org/data/2.5/weather?lat="+ position.coords.latitude +"&lon="+ position.coords.longitude+"&appid=44db6a862fba0b067b1930da0d769e98", function(json) {
var c = json.coord;
$(".message").html(c);
jQuery(document).ready(function($) {
$.ajax({
url : "http://api.wunderground.com/api/Your_Key/geolookup/conditions/q/IA/Cedar_Rapids.json",
dataType : "jsonp",
success : function(parsed_json) {
var location = parsed_json['location']['city'];
var temp_f = parsed_json['current_observation']['temp_f'];
alert("Current temperature in " + location + " is: " + temp_f);
}
});
});
function getWeather(city, callback) {
var url = 'http://api.openweathermap.org/data/2.5/weather';
$.ajax({
dataType: "jsonp",
url: url,
jsonCallback: 'jsonp',
data: { q: city },
cache: false,
success: function (data) {
data.city = city;
callback(data);
}
});
}
.but:hover {
background-color: black;
border-color: black;
color: red;
transition-property: font-size;
transition-duration: 0.2s;
transform: scale(1.2);
}
tstusr441 sends brownie points to @wcat13 :sparkles: :thumbsup: :sparkles:
:star: 272 | @wcat13 | http://www.freecodecamp.com/wcat13
.but:hover {
background-color: black;
border-color: black;
color: red;
transition: .3s;
transform: scale(1.2);
}
this will add the transition speed you had
tstusr441 sends brownie points to @wcat13 and @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 273 | @wcat13 | http://www.freecodecamp.com/wcat13
:star: 1096 | @mutantspore | http://www.freecodecamp.com/mutantspore
nikhil1011 sends brownie points to @wcat13 and @rphares :sparkles: :thumbsup: :sparkles:
:star: 274 | @wcat13 | http://www.freecodecamp.com/wcat13
shkurata sends brownie points to @ellf :sparkles: :thumbsup: :sparkles:
expression
var right before you try to eval()
it... you have  
in there.
console.log(expression);
after line 44 will show you the INPUT to your eval()
call on the next line.
eval()
an unexpected string.
blayman sends brownie points to @ellf and @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 910 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
:star: 323 | @ellf | http://www.freecodecamp.com/ellf
console.log()
there is an error in the console that would have helped point you to the problem. CodePen recently added a "console" window (see the button for it on the lower left of the screen), but the browser console can be a little more informative
Debug Mode
in the Change View
options that will open your pen in a full screen mode that makes working with the browser's DevTools much easier.
@Ellf I'm using firefox, but I tried opening it in Chrome with the same issue. Maybe I'm doing something wrong in the CSS:
.screen{
background-color:white;
color:black;
position:relative;
height:22px;
width:50%;
}
blayman sends brownie points to @ellf :sparkles: :thumbsup: :sparkles:
:warning: blayman already gave ellf points
...
// Test 555-555-5555
if(/\d{3}-\d{3}-\d{4}/.test(str)) {
return true;
// Test (555)555-5555
} else if(/\(\d{3}\)\d{3}-\d{4}/.test(str)) {
return true;
// Test (555) 555-5555
} else if(/\(\d{3}\) \d{3}-\d{4}/.test(str)) {
return true;
...
} else {
return false;
}
?
would be helpful here.
alcatrats sends brownie points to @mattyamamoto :sparkles: :thumbsup: :sparkles:
:star: 911 | @mattyamamoto | http://www.freecodecamp.com/mattyamamoto
zipline calculator
calculator
I feel really dumb that I can get this. I am at Stand in Line and feel very clueless. Can someone help me figure out what I'm doing wrong? This is what I have right now and am clearly not getting it.
function queue(arr, item) {
// Your code here
var myArr = arr.push(item);
var newArr = myArr.shift();
return newArr;
}
// Test Setup
var testArr = [1,2,3,4,5];
// Display Code
console.log("Before: " + JSON.stringify(testArr));
console.log(queue(testArr, 6)); // Modify this line to test
console.log("After: " + JSON.stringify(testArr));
abel1987 sends brownie points to @susangrattan :sparkles: :thumbsup: :sparkles:
:star: 323 | @susangrattan | http://www.freecodecamp.com/susangrattan
susangrattan sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:star: 1097 | @mutantspore | http://www.freecodecamp.com/mutantspore
susangrattan sends brownie points to @mutantspore :sparkles: :thumbsup: :sparkles:
:warning: susangrattan already gave mutantspore points