@buiphuking this may be useful: How to Build You Own Ai Assistant Using Api.ai :sparkles:
wrblack sends brownie points to @mbarmawi :sparkles: :thumbsup: :sparkles:
:cookie: 295 | @mbarmawi |http://www.freecodecamp.com/mbarmawi
wrblack sends brownie points to @mbarmawi :sparkles: :thumbsup: :sparkles:
:warning: wrblack already gave mbarmawi points
danstockham sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 505 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
anakin771 sends brownie points to @gregatgit and @khaduch :sparkles: :thumbsup: :sparkles:
:cookie: 603 | @gregatgit |http://www.freecodecamp.com/gregatgit
:star2: 1344 | @khaduch |http://www.freecodecamp.com/khaduch
leanhduy1998 sends brownie points to @ndburrus :sparkles: :thumbsup: :sparkles:
:cookie: 577 | @ndburrus |http://www.freecodecamp.com/ndburrus
leanhduy1998 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 506 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Good evening, Campers. I'm trying to limit a scrolling action so that it doesn't scroll over the menu at the top of the page. Can someone point me in the right direction, please? (Is this a z-index
issue?)
Thanks in advance. Here's my CodePen: http://codepen.io/andreas2249/pen/rLMOPw/
andreas2249 sends brownie points to @lcassettai :sparkles: :thumbsup: :sparkles:
:cookie: 334 | @lcassettai |http://www.freecodecamp.com/lcassettai
@lcassettai
http://codepen.io/buiphuking/pen/JKoEZG?editors=0011
if($(this).html() == ''){
$(this).append(player);
checkWin(player);
if($('#myModal3').is(':visible'))
{
return;
}
if($('#' + computerMove).html() == ''){
$('#' + computerMove).append(computer);
}else{
return false;
}
//if(checkWin(computer)) return false;
}else{
return false;
}
i pick X, if i win, O stop picking
andreas2249 sends brownie points to @lcassettai :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave lcassettai points
<nav class="navbar navbar-fixed-top navbar-default">
andreas2249 sends brownie points to @lcassettai :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave lcassettai points
I have a set of divs with multiple links in them. I would like to make it so the entire div is clickable and triggers the first link. I tried
$('.collection-item').click(function() {
window.location = $(this).find('a').first().attr('href');
return false;
});
It works, but the other links within the div are no longer clickable. Any suggestions?
<button id="X" onclick="first()" type="button" data-toggle="modal" data-target="#myModal2" data-dismiss="modal" class="btn btn-info">X</button>
<button id="O" onclick="first()" type="button" data-toggle="modal" data-target="#myModal2" data-dismiss="modal" class="btn btn-info">O</button>
arr2.map(function(comparison) {
arr1.map(function(output) {
if ( comparison[1] == output[1] ) console.log(comparison[1]);
});
});
navbar-default
adds the white color to the background. I'd like use your solution -- but not have it add the background color. Any suggestions to override that effect? Thanks in advance. :)
andreas2249 sends brownie points to @lcassettai :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave lcassettai points
navbar-default
class with this -- but it didn't work:.navbar-default {
background-color:teal;
}
but background-color: none;
transparent
type of method... Tried it. Not quite working: http://codepen.io/andreas2249/pen/rLMOPw/
// Needs to be this
function Comparator(a, b) {
if (a[1] > b[1]) return true;
return false;
}
[ [ 88, 'Bowling Ball' ],
[ 2, 'Dirty Sock' ],
[ 3, 'Hair Pin' ],
[ 5, 'Microphone' ],
[ [ 3, 'Half-Eaten Apple' ] ], // double nested
[ [ 7, 'Toothpaste' ] ] ] // double nested
leanhduy1998 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 508 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
@lcassettai, yes, agree. And that's what I'm trying to solve. So I think your idea of using a transparent background might be the right idea. But when I added it to the CSS section, as follows, the background become transparent (most of it did) -- but now the text covers that area again.
This is what I added:
.navbar-default {
background-color: transparent;
}
Does adding this mess up up the rest of the navbar-default
class?
.navbar{
z-index:999 !important;
top:0px;
left:0px;
position:fixed;
background:rgba(256,265,256,0.3);
border-bottom:1px solid;
box-shadow: -2px 7px 19px -3px rgba(0,0,0,0.75);
}
adventurebear sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 509 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
@lcassettai, wow! That is a GORGEOUS effect! Thanks for that. I'm keeping that. The only thing I'd like to solve is that when text scrolls up, that it will appear not to go any higher than the bottom of the shadow of that navigation bar at the top of the screen.
They way it is now (very much improved :) ), the main content still shows thru the logo and nav menu when scrolling. Thanks!
andreas2249 sends brownie points to @lcassettai :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave lcassettai points
rhawkthrone sends brownie points to @lcassettai :sparkles: :thumbsup: :sparkles:
:cookie: 335 | @lcassettai |http://www.freecodecamp.com/lcassettai
adventurebear sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: adventurebear already gave jdtdesigns points
Oh, definitely, @lcassettai. I give credit where credit is due. I appreciate all of your effort very much. :)
I like this new change the way that pops up. Very nice. Here's what is still happening:
adventurebear sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: adventurebear already gave jdtdesigns points
z-index
of 999:.lcassettai-navbar{
z-index:999; !important;
top:0px;
left:0px;
position:fixed;
background:rgba(256,265,256,0.3);
border-bottom:1px solid;
box-shadow: -2px 7px 19px -3px rgba(0,0,0,0.75);
}
andreas2249 sends brownie points to @jdtdesigns and @lcassettai :sparkles: :thumbsup: :sparkles:
:cookie: 336 | @lcassettai |http://www.freecodecamp.com/lcassettai
:cookie: 510 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
@jdtdesigns, and there's this one that opens up a cool "trap door" effect when scrolling text is getting closer:
jdtdesigns sends brownie points to @adventurebear :sparkles: :thumbsup: :sparkles:
:cookie: 441 | @adventurebear |http://www.freecodecamp.com/adventurebear
.lcassettai-navbar{
transition:1s;
z-index:999; // Don't need important
top:0px;
left:0px;
position:fixed;
background: #fff; // Don't need important
border-bottom:1px solid rgba(0,0,0,03);
box-shadow: -2px 5px 19px -3px rgba(0,0,0,0.75);
}
andreas2249 sends brownie points to @jdtdesigns and @lcassettai :sparkles: :thumbsup: :sparkles:
:warning: andreas2249 already gave lcassettai points
:warning: andreas2249 already gave jdtdesigns points
<i class="wi wi-yahoo-##>
to display. Here's the link with the app so far. Any help much appreciated.Can you help me with my bottom function. It takes a value from till and takes that off change needed.. I commented it up.. Its crashing my browser at the minute though... I think I need somethin with---- chgArr.push(i)--- But possibly some other changes aswell..
function checkCashRegister(price, cash, cid) {
var val;
var cost=arguments[0];
var money=arguments[1];
var till= arguments[2];
var count=0;
var arr=[];
var change= money-cost;
if(change<0){
change=Math.abs(change);}//this makes change positive if its negative value
else change=change;
for(i=0; i<till.length;i++){
count+=till[i][1];}
if(change>count){
return "Insufficient Funds";
// Make a count that totals till values. If change is more than till then say so
} else{
var chgCount=0;
var chgArr=[];
for(i=till.length-1;i<till.length;i--){ //go through till from highest to lowest
while(change>chgCount){//while change is more than 0
chgCount+=till[i][1]; //add number to change from till
chgArr.push(till[i]);//put that in an array
change-=till[i][1];//Take that number off change.
}return chgArr;
}
}
}
checkCashRegister(2000.50, 20.00, [["PENNY", 1.01], ["NICKEL", 2.05], ["DIME", 3.10], ["QUARTER", 4.25], ["ONE", 90.00], ["FIVE", 55.00], ["TEN", 20.00], ["TWENTY", 60.00], ["ONE HUNDRED", 100.00]]);
the last else is the problem
for(i=till.length-1;i<till.length;i--)
microcyberz sends brownie points to @endencia :sparkles: :thumbsup: :sparkles:
:cookie: 10 | @endencia |http://www.freecodecamp.com/endencia
Hi Everybody, I’m having difficulties with the Pomodoro Project.
Problem 1: My variable „sessionLength“ is initially set to 25 (line 4) and then should be changed by the functions „minSession“ (line 42) and „plusSession“ (line 54) and then affect the variable „time“ in line 65. But somehow it stays at the initial value of 25.
Problem 2: Also, if I pause the countdown and then restart it again it gets faster each time I do that.
Where is my mistake?
Here is my code: http://codepen.io/Holic101/pen/mEPazO
function loadDoc(url, cfunc){
var xhttp;
xhttp = new XMLHttpRequest();
xhttp.onreadychanged=function(){
if(xhttp.status==200 && xhttp.reasyState==4){
cfunc(xhttp);
}
};
xhttp.open("GET",url,true);
xhttp.send();
}
function location(xhttp){
document.getElementById("out").innerHTML=xhttp.responseText;
}
loadDoc('ip-api.com/json', location);
Just finishing up my "Random Quote Generator" trying to get the twitter button to work. I was using the developer documents as a guide. But, obviously, I'm not doing it correctly. It seems like you don't need to add more javascript since it plugs into the html.
Here is the code:
http://codepen.io/flindip/pen/mEEjXa
:cookie: 328 | @manu-4216 |http://www.freecodecamp.com/manu-4216
holic101 sends brownie points to @manu-4216 :sparkles: :thumbsup: :sparkles:
holic101 sends brownie points to @manu-4216 :sparkles: :thumbsup: :sparkles:
:warning: holic101 already gave manu-4216 points
Hi everyone!
Can someone tell why this isn't working with width less than 700px? (max-width)
It aplies just the css that is for 700px at least. (min-width)
I'm using Chrome for testing.
```<link rel="stylesheet" type="text/css" media="(max-width: 700px)" href="styles-400.css">
<link rel="stylesheet" media="(min-width: 700px)" href="styles-700.css">```
Alright, I am working on the "Random Quote Generator." I think I found a method to make it work that is pretty simple using widgets and web intent: Still trying to make it work.
Here are the methods I'm using:
https://dev.twitter.com/web/tweet-button/web-intent
https://dev.twitter.com/web/tweet-button/javascript-create
Here is my code:
http://codepen.io/flindip/pen/mEEjXa
tdandelion sends brownie points to @buckshot307 :sparkles: :thumbsup: :sparkles:
:cookie: 325 | @buckshot307 |http://www.freecodecamp.com/buckshot307
stblack sends brownie points to @buckshot307 and @tdandelion :sparkles: :thumbsup: :sparkles:
:warning: could not find receiver for tdandelion
:cookie: 326 | @buckshot307 |http://www.freecodecamp.com/buckshot307
href="https://twitter.com/intent/tweet?text=Hello%20world"
is the basic link to compose a tweet. That's a good place to start. Not sure how far along you are.
@hiltydiggs the approach I'm taking is using a widget:
https://dev.twitter.com/web/tweet-button/javascript-create
https://dev.twitter.com/web/tweet-button/web-intent
Here is the code:http://codepen.io/flindip/pen/mEEjXa
@Ferdyboy81
You can use:
min-height: 200px;
min-width: 150px;
display: inline-block;
But I really encourage you to research on display: block, inline, and inline-block
break;
after case 1:
.
flindip sends brownie points to @hiltydiggs and @andreas2249 :sparkles: :thumbsup: :sparkles:
:cookie: 529 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
:warning: could not find receiver for andreas2249
flindip sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:warning: flindip already gave hiltydiggs points
twttr.widgets.load()
will update the tweet text according to documentation. It would have to called each time a new quote is requested.
https://
?
mikser73 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 511 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
@jdtdesigns I implemented it with an anchor. But I'm trying to get it to display the randomQuote(val)element...
Do I have to write a function for it?
href=https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text="randomQuote(val)"><button type="button" class="btn btn-primary" id="btn2">Tweet</button></a>
adiljawad sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 530 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
$(document).ready(function() {
var channel = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
var api = 'https://api.twitch.tv/kraken/streams/';
$.getJSON(api, function() {
for (var i = 0; i < channel.length; i++) {
$.getJSON(api + channel[i],function(data){
//console.log(data.stream);
if (data.stream===null){
console.log(channel[i]+' is currently Offline');
}
else{
console.log(channel[i]+' is Online');
}
});
}
});
});
$.getJSON
twice. As you have it, it should iterate through channel
and call $.getJSON
for each.
@RoniqueRicketts
$(document).ready(function() {
var channel = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
var api = 'https://api.twitch.tv/kraken/streams/';
for (var i = 0; i < channel.length; i++) {
$.getJSON(api + channel[i],function(data){
//console.log(data.stream);
if (data.stream===null){
console.log(channel[i]+' is currently Offline');
}
else{
console.log(channel[i]+' is Online');
}
});
}
});
Something like that
<div ng-include="'about.html'">
:warning: flindip already gave hiltydiggs points
flindip sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
forEach()
is just another way to iterate throught the channel
var. channel.forEach(function(){$.getJSON...})
<div ng-include="about.html">
not works
$(document).ready(function() {
var channel = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
var api = 'https://api.twitch.tv/kraken/streams/';
for (var i = 0; i < channel.length; i++) {
var current = channel[i];
$.getJSON(api + current,function(data){
if (data.stream===null) {
console.log(current +' is currently Offline');
}
else {
console.log(current ' is Online');
}
});
};
});
$(document).ready(function() {
var channel = ["ESL_SC2", "OgamingSC2", "cretetion", "freecodecamp", "storbeck", "habathcx", "RobotCaleb", "noobs2ninjas"];
var api = 'https://api.twitch.tv/kraken/streams/';
for (var i = 0; i < channel.length; i++) {
var currentStreamer = channel[i];
var eachURL = 'https://api.twitch.tv/kraken/streams/' + currentStreamer + '?callback=?';
(function(i, eachURL, currentStreamer) {
$.getJSON(eachURL, function(response) {
if (response.status === 422) {
console.log('Error!');
} else if (response.stream !== null) {
console.log(currentStreamer + ' is online');
} else if (response.stream === null) {
console.log(currentStreamer + ' is offline');
}
});
})(i, eachURL, currentStreamer);
}
});
I have a div which contains multiple links. I would like to make it so clicking anywhere in the div triggers the first link. I have tried
$('.collection-item').click(function() {
window.location = $(this).find('a').first().attr('href');
return false;
});
But the other links in the div are no longer clickable. Any suggestions?
event.stopPropagation();
to all of the other links.
$('.collection-item a').click(function(event){event.stopPropagation();});
console.log()
with a function that handles each situation and appends it to the page.
:cookie: 531 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
adzam5 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
MikeBeers @MikeBeers 10:34
I am looking for help on pushing an onclick element to an array inside an object. If I take the array out of the object I can add to the array no problem. Just wonding if I can get a little help figuring this out.
<div id="green" class="quarter green" onmousedown="display.gDown(this)" onmouseup="display.gUp(this)" onclick="game.player(this)">
object
var game = {
player: function(obj) {
var playerArr = [];
alert("obj " + obj.id);
playerArr.push(obj.id);
alert("player " + playerArr);
},
MikeBeers @MikeBeers 10:40
here is the PEN
https://codepen.io/MikeBeers/pen/MeejWE?editors=0010
Um, what should I put in to link for my randomQuote call in the href text input for my twitter button?
Here is the code:
http://codepen.io/flindip/pen/mEEjXa
<a href="http://anotherpen.com" target="_blank">
<img src="http://image.link" alt="">
</a>
tdandelion sends brownie points to @mattboland :sparkles: :thumbsup: :sparkles:
:cookie: 386 | @mattboland |http://www.freecodecamp.com/mattboland
danielmw34 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 512 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
npm start
the project so that webpack runs. Then I open the app in localhost. Then I right click, inspect source, and grabbed the code from the Dev tools. Created new folder with that code, and FTP'd that with Filezilla. Worked, my React app is up on the web, but there must be a better way.
document.getElementById('get-quote').addEventListener('click', showQuote);
var showQuote = function() {
var quote = data.quote, // Refers to the quote in your quotes list
tweetLink = document.getElementById('tweet'); // Refers to the tweet link
tweetLink.setAttribute('href', 'https://twitter.com/intent/tweet?hashtags=quotes&related=freecodecamp&text=' + quote);
};
flindip sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 513 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
sumitsrbh sends brownie points to @konikodes :sparkles: :thumbsup: :sparkles:
:cookie: 306 | @konikodes |http://www.freecodecamp.com/konikodes
adventurebear sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 514 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
flindip sends brownie points to @konikodes :sparkles: :thumbsup: :sparkles:
:cookie: 307 | @konikodes |http://www.freecodecamp.com/konikodes
oxide94git sends brownie points to @konikodes and @thomlom :sparkles: :thumbsup: :sparkles:
:cookie: 389 | @thomlom |http://www.freecodecamp.com/thomlom
:cookie: 308 | @konikodes |http://www.freecodecamp.com/konikodes
konikodes sends brownie points to @flindip and @oxide94git :sparkles: :thumbsup: :sparkles:
:cookie: 279 | @flindip |http://www.freecodecamp.com/flindip
:cookie: 280 | @oxide94git |http://www.freecodecamp.com/oxide94git
konikodes sends brownie points to @oxide94git :sparkles: :thumbsup: :sparkles:
:warning: konikodes already gave oxide94git points
flindip sends brownie points to @konikodes :sparkles: :thumbsup: :sparkles:
:warning: flindip already gave konikodes points
<div id="page-1">
Section 1
<a href="#page-2">Goto Section 2</a>
</div>
<div id="page-2">Section 2</div>
jlouiss sends brownie points to @konikodes :sparkles: :thumbsup: :sparkles:
:cookie: 309 | @konikodes |http://www.freecodecamp.com/konikodes
jlouiss sends brownie points to @konikodes :sparkles: :thumbsup: :sparkles:
:warning: jlouiss already gave konikodes points
:point_up: June 18, 2016 5:35 PM
Even though nobody was able to help, I'll tell you that the solution was making sure that the jquery and bootstrap libraries were loaded not just on the CSS tab of the pen settings, but also the JS tab http://puu.sh/pxBm1/46a31262b3.png
darksmurf sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1060 | @dhcodes |http://www.freecodecamp.com/dhcodes
max77p sends brownie points to @konikodes :sparkles: :thumbsup: :sparkles:
:cookie: 310 | @konikodes |http://www.freecodecamp.com/konikodes
max77p sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1061 | @dhcodes |http://www.freecodecamp.com/dhcodes
mcorby17 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 515 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
&callback=?
mcorby17 sends brownie points to @gregatgit and @jdtdesigns :sparkles: :thumbsup: :sparkles:
:warning: mcorby17 already gave jdtdesigns points
:cookie: 605 | @gregatgit |http://www.freecodecamp.com/gregatgit
tonnamb sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:cookie: 606 | @gregatgit |http://www.freecodecamp.com/gregatgit
tonnamb sends brownie points to @gregatgit :sparkles: :thumbsup: :sparkles:
:warning: tonnamb already gave gregatgit points
Good afternoon, Campers. I'm trying to find out how to add some margin to a Bootstrap .well class. My anchor tags for 'Portfolio" and 'About' links have padding so that there's some white space between those sections and the menu at the top of the page.
I'm struggling to add the same amount of padding / white space to the 'Contact' page div which has a Bootstrap .well class. Can someone please have a look at my CodePen and offer a starting point to resolve this? Thanks in advance. :) http://s.codepen.io/andreas2249/debug/PzGNZm#
.jumbotron
class. If you remove line 2 and refresh, that line spans the width of the viewport. How it's done might be "buried" in Bootstrap.
andreas2249 sends brownie points to @hiltydiggs :sparkles: :thumbsup: :sparkles:
:cookie: 532 | @hiltydiggs |http://www.freecodecamp.com/hiltydiggs
.well
@hiltydiggs ? Stumped here.