trayuk sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 656 | @gregatgit |http://www.freecodecamp.com/gregatgit
caep2015 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 657 | @gregatgit |http://www.freecodecamp.com/gregatgit
caep2015 sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:warning: caep2015 already gave gregatgit points
adventurebear sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1405 | @khaduch |http://www.freecodecamp.com/khaduch
bgeraci714 sends brownie points to @nawrockp :sparkles: :thumbsup: :sparkles:
:cookie: 332 | @nawrockp |http://www.freecodecamp.com/nawrockp
96street sends brownie points to @nawrockp :sparkles: :thumbsup: :sparkles:
:cookie: 333 | @nawrockp |http://www.freecodecamp.com/nawrockp
setInterval
for something repeating, like a timer (Pomodoro, for example). setTimeout
for a one-time event, or possibly a short series of events such as the Simon game - although I would still use setInterval for that, myself. I hope that helps - gotta run!
trayuk sends brownie points to @athaman :sparkles: :thumbsup: :sparkles:
:cookie: 511 | @athaman |http://www.freecodecamp.com/athaman
for(var i = 0; i < simon.length; i++) { // make each blink sequentially
(function(i) {
setTimeout(function() {
soundIndex = color.indexOf(simon[i]);
sounds[soundIndex].play();
$("#"+simon[i]).fadeOut(150).fadeIn(150); // make selected slice blink
}, i * 800);
})(i); // make it user's turn to play
}
var forismatic = "http://api.forismatic.com/api/1.0/";
$.getJSON( forismatic, {
method:getQuote,
key:"",
lang:"en;",
format: "json"
})
trayuk sends brownie points to @wbac88 and @ajesamson :sparkles: :thumbsup: :sparkles:
:cookie: 338 | @ajesamson |http://www.freecodecamp.com/ajesamson
:cookie: 275 | @wbac88 |http://www.freecodecamp.com/wbac88
trayuk sends brownie points to @wbac88 :sparkles: :thumbsup: :sparkles:
:warning: trayuk already gave wbac88 points
$(document).ready(function(){
$("#getMessage").click(function(){
$.getJSON("GET http://quotes.rest/quote.json", function(result){
$.each(result, function(i, field){
$("#quote-block").append(field + " ");
});
});
});
});
wbac88 sends brownie points to @expiratio :sparkles: :thumbsup: :sparkles:
:cookie: 282 | @expiratio |http://www.freecodecamp.com/expiratio
$(document).ready(function() {
$.getJSON("http://quotes.rest/quote.json", function(json) {
json = JSON.stringify(json);
$("#test-span").html(json);
});
});
$("ID").click();
function
Math.random()
cal
cjrutherford sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1181 | @dhcodes |http://www.freecodecamp.com/dhcodes
math.random()
wbac88 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1182 | @dhcodes |http://www.freecodecamp.com/dhcodes
ewathedoer sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1183 | @dhcodes |http://www.freecodecamp.com/dhcodes
document.getElementById
. Not ID
.
cjrutherford sends brownie points to @garysiu :sparkles: :thumbsup: :sparkles:
:cookie: 110 | @garysiu |http://www.freecodecamp.com/garysiu
Math.random()
class again....
function generateQuote(){
var seed = Math.floor(Math.random() * qta.length);
quote.innerHTML = "' " + qta[seed].text + " '";
author.innerHTML = "--" + qta[seed]['author'];
}
window.onload
cjrutherford sends brownie points to @garysiu :sparkles: :thumbsup: :sparkles:
:warning: cjrutherford already gave garysiu points
pkrueck sends brownie points to @dave1089 :sparkles: :thumbsup: :sparkles:
:cookie: 279 | @dave1089 |http://www.freecodecamp.com/dave1089
font-weight: bold;
property, if you want to style a section of text. But <strong>
works.
@pkrueck I can still see the error.. why don't you use only one $(document).ready(function(){
$('a').click(function(event){
// event.preventDefault();
var hash = this.hash;
$('html, body').animate({
'scrollTop': $(hash).offset().top
},'800',function(){
window.location.hash = hash;
});
});
});
@pkrueck - I tried some change on your page and it looks like it made it work - it was getting some errors 2VM207 pen.js:14Uncaught TypeError: Cannot read property 'top' of undefined
when I clicked on one of your navbar items. So I changed the sections to <a id="About">
, etc. and the code in your scrolling functions to this:
$('a[href="#About"]').click(function(e) {
e.preventDefault();
var targetOffset = $('a[id="About"]').offset().top; /// <<< this is the key change, to "id" from "href"
$('body').animate({
scrollTop: targetOffset
},
1000
);
});
and it seems to work.
ssaabbiirr sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1406 | @khaduch |http://www.freecodecamp.com/khaduch
<img id="sndpic" class="center-block"
on your image.
rjvgdm sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1407 | @khaduch |http://www.freecodecamp.com/khaduch
<style>
body{
background-color: gray;
}
h1, h2{
color:black;
}
.photo-position{
width:1000px;
position:center;
}
.img-border{
border-color: white;
border-width: 20px;
border-style: solid;
}
</style>
<body>
<div class="container-fluid">
<p><h1 class="text-center" >Dr. Norman Bourlag</h1> </p><br>
<p><h2 class="text-center" style="font-style:italic">The Man who saved a billion lives</h2></p><br>
<div class="row text-center ">
<figure>
<img class="img-responsive center-block img-border " src="https://c2.staticflickr.com/4/3689/10613180113_fdf7bcd316_b.jpg">
<figcaption>Dr. Norman Borlaug, second from left, trains biologists in Mexico on how to increase wheat yields - part of his life-long war on hunger.</figcaption>
</figure>
</div>
</div>
</body>
center-block
I have the tribute page built...but need help working out a few things
All suggestions apprectiated!
http://codepen.io/glowlo/pen/rLzZqr
deadpool37 sends brownie points to @lukenetti3 :sparkles: :thumbsup: :sparkles:
:cookie: 280 | @lukenetti3 |http://www.freecodecamp.com/lukenetti3
ryanwfile sends brownie points to @uniforlyff :sparkles: :thumbsup: :sparkles:
:cookie: 376 | @uniforlyff |http://www.freecodecamp.com/uniforlyff
@vvkgdm Try this:
#1: Add a class to the div that your image is contained in:
<div class="circle-padding">
<img class="img-responsive img r" src="https://scontent.fmaa1-1.fna.fbcdn.net/v/t1.0-9/12249604_1022118007856065_8433404923222012749_n.jpg?oh=f503c73a48db1bd30f5aba0711d5932f&oe=58336AD7" align="midddle" id="img1">
</div>
#2: Use CSS to add padding to the class
.circle-padding {
padding-bottom: 75px;
}
This will allow you to add padding to the image without changing the border. :)
ryanwfile sends brownie points to @uniforlyff :sparkles: :thumbsup: :sparkles:
:warning: ryanwfile already gave uniforlyff points
mania7539 sends brownie points to @seemly :sparkles: :thumbsup: :sparkles:
:cookie: 23 | @seemly |http://www.freecodecamp.com/seemly
mania7539 sends brownie points to @uniforlyff :sparkles: :thumbsup: :sparkles:
:cookie: 378 | @uniforlyff |http://www.freecodecamp.com/uniforlyff
$(document).on('ready', function() {
var title = $('<h1>').text('Chat').addClass('title');
var chatDisplay = $('<div>').attr('id', 'chat-display');
var form = $('<form></form>');
$(form).append('<input type="text" name="your-message" id="your-message"><input type="submit" id="submit" value="Submit">')
$('body').append(title);
$('body').append(chatDisplay);
$('body').append(form);
function updateChat(data) {
data.forEach(function(obj) {
var name = '<span class="name">' + obj.created_by + '</span>';
var message = '<span class="message">' + obj.message + '</span>';
$(chatDisplay).append(name + ': '+ message + '<br />');
$(message).addClass('message');
})
}
$.ajax({
type: 'GET',
dataType: 'json',
url: 'URL',
success: function(response) {
updateChat(response);
},
error: function() {
console.log('Error! Trouble Receiving data!');
}
})
$('form').submit(function(event) {
event.preventDefault();
$.ajax({
type: 'POST',
contentType: 'application/json',
url: 'SAME URL',
data: JSON.stringify({'created_by': 'SuperMario','message': $('#your-message').val()
}),
success: function(response) {
$('#your-message').val('');
$.get('SAME URL', function(response){
console.log('in func');
console.log(response);
updateChat(response)
})
},
error: function(error) {console.log(error)}
})
})
});
mania7539 sends brownie points to @seemly :sparkles: :thumbsup: :sparkles:
:warning: mania7539 already gave seemly points
mania7539 sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 1659 | @moigithub |http://www.freecodecamp.com/moigithub
mashadim sends brownie points to @seemly :sparkles: :thumbsup: :sparkles:
:cookie: 36 | @seemly |http://www.freecodecamp.com/seemly
dataType: 'jsonp',
to your .ajax call
$.ajax({
dataType: 'jsonp',
url: "https://en.wikipedia.org/w/api.php?action=opensearch&format=json&search=cars",
success: function(data) {
lukenetti3 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:cookie: 641 | @tylermoeller |http://www.freecodecamp.com/tylermoeller
lukenetti3 sends brownie points to @tylermoeller :sparkles: :thumbsup: :sparkles:
:warning: lukenetti3 already gave tylermoeller points
danielsusser sends brownie points to @harry97 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for harry97
danielsusser sends brownie points to @darrylblake :sparkles: :thumbsup: :sparkles:
:cookie: 22 | @darrylblake |http://www.freecodecamp.com/darrylblake
http://codepen.io/duel_drawer8/pen/xOLErV
http://codepen.io/duel_drawer8/pen/xOLErV
```
eraofdiscord sends brownie points to @harry97 :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for harry97