These are chat archives for FreeCodeCamp/HelpFrontEnd

2nd
Oct 2016
c0d0er
@c0d0er
Oct 02 2016 00:18
This message was deleted

i tried to change background color in my code, it doesnt work, could you check why? i guess the problem code mainly here:

function changeColor(){
  var random=Math.floor(Math.random()*256);
  var color="rgb("+random+","+random+","+random+")";
  //var change=document.getElementById("quo");
  //change.style.backgroundColor=color;
  $(".quote-area").attr("style.backgroundColor", color);

here is my code: http://codepen.io/c0d0er/pen/ORpgJo

JD Tadlock
@jdtdesigns
Oct 02 2016 00:31
@c0d0er You had quite a few errors. You only put what's between the <body></body> into the html panel. Any libraries/frameworks are added though Settings. I coded the js to work. You can adjust it to your liking. http://codepen.io/jdtadlock/pen/YGAAyR?editors=1000
c0d0er
@c0d0er
Oct 02 2016 00:33
thanks! @jdtdesigns
CamperBot
@camperbot
Oct 02 2016 00:33
c0d0er sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 630 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
c0d0er
@c0d0er
Oct 02 2016 01:09
@jdtdesigns why you use the following function to get different number every time, but when i use var random=Math.floor(Math.random()*256); inside var color="rgba("+random+","+random+","+random+",0.3)";, i can only get same number 3 times?
var random = function() {
    return Math.floor(Math.random() * 256);
  }
silver537
@silver537
Oct 02 2016 01:21
feedback would be much apprectiated: http://codepen.io/Silver537/pen/vXZXmd?editors=1100
Dylan
@dhcodes
Oct 02 2016 01:25
@silver537 a little animation heavy for me, but it works well for the most part
Twitter button doesn't seem to work yet
good job
silver537
@silver537
Oct 02 2016 01:26
which animation?
Dylan
@dhcodes
Oct 02 2016 01:29
@silver537 the twitter button
i like the shaking animation
silver537
@silver537
Oct 02 2016 01:35
@dhcodes lol it's a spinning bird! ^_^ well thanks.
CamperBot
@camperbot
Oct 02 2016 01:35
silver537 sends brownie points to @dhcodes :sparkles: :thumbsup: :sparkles:
:star2: 1436 | @dhcodes |http://www.freecodecamp.com/dhcodes
Dylan
@dhcodes
Oct 02 2016 01:37
@silver537 i'm just giving feedback. It's your site. Most sites only have very subtle animations though
be yourself :)
Lucien
@jmlucien
Oct 02 2016 01:37
Thank you @glgirl28
CamperBot
@camperbot
Oct 02 2016 01:37
jmlucien sends brownie points to @glgirl28 :sparkles: :thumbsup: :sparkles:
:cookie: 345 | @glgirl28 |http://www.freecodecamp.com/glgirl28
silver537
@silver537
Oct 02 2016 01:38
i was actually hoping for more negative feedback. but the lack of it confirms that i underestimated myself.
Dylan
@dhcodes
Oct 02 2016 01:51
@silver537 well it works for the most part and is responsive
just work on the twitter button and you'll be gtg
silver537
@silver537
Oct 02 2016 01:52
@dhcodes that's what im trying to figure out.
Anukath
@Anukath
Oct 02 2016 01:55
Hello guys, I recently graduated from a computer programming course. I am looking for a programming job or an internship near Toronto, Canada. Any recommendations
?
Julia
@LittleTokio
Oct 02 2016 02:30
Hey I was wondering where you guys found external info for your portfolio page. Like how to do a nav bar and such.
d wilder
@alhazen1
Oct 02 2016 02:35
@LittleTokio Honestly I copied my navbar from the Bootstrap doc site example and removed what I didn't need. I did take the time to figure out how it worked before using it.
Julia
@LittleTokio
Oct 02 2016 02:35
awesome thanks @alhazen1
CamperBot
@camperbot
Oct 02 2016 02:35
littletokio sends brownie points to @alhazen1 :sparkles: :thumbsup: :sparkles:
:cookie: 398 | @alhazen1 |http://www.freecodecamp.com/alhazen1
JD Tadlock
@jdtdesigns
Oct 02 2016 04:39
@LittleTokio It depends on how much you know coming into fcc. I had 4 years coding experience, so the standard website creation stuff is knowledge i've had for a long time. The fun stuff for me is the programming challenges.
AliFox15
@AliFox15
Oct 02 2016 04:54
<div class="row">
<button class="btn btn-block btn-primary col-xs-4">PORTFOLIO</button>
<button class="btn btn-block btn-primary col-xs-4">ABOUT</button>
<button class="btn btn-block btn-primary col-xs-4">CONTACT</button>
</div>
Can anyone tell me why the button is not in the same row?
Pietrz
@Pietrz
Oct 02 2016 05:24
Hey guys, Can some help me out? My a element should have the anchor text of "cat photos". How can i do this?
<h2 class="red-text">
<a href="http://freecatphotoapp.com">CatPhotoApp
</a>
</h2>
c0d0er
@c0d0er
Oct 02 2016 05:25
function pre(e){ e.preventDefault(); }//why i change to event, it will work perfectly to prevent after press enter all search results disappear;
function loadData() {
    var wikiUrl="https://en.wikipedia.org/w/api.php?format=json&action=query&generator=search&gsrnamespace=0&gsrlimit=10&prop=extracts&exintro&explaintext&exsentences=1&exlimit=max&callback=?&gsrsearch="
    var value=$("input").val();

    $.getJSON(wikiUrl+value, function(data) {
            var obj=data.query.pages;
            var HTMLnodes = "";    

            // build up the results
            $.map(obj,function(v,i){
                HTMLnodes += "<div id='wikiDiv'><a href='https://en.wikipedia.org/wiki/"
                    +v.title+"' target='_blank'><h2 id='wikiTitle'>"+v.title+
                    "</h2>"+"</a><h4 id='wikiExtract'>"
                    +v.extract+"</h4></div>"      
            });

            //remove old search results
            $("#wikiContent").empty();

            //add new results
            $("#wikiContent").append(HTMLnodes);     
    });
  pre(e);//why i change to event, it will work perfectly to prevent after press enter all search results disappear;
}
the above questions is for this code: http://codepen.io/c0d0er/pen/WGkQvk?editors=1010
question: pre(e);//why i change to event, it will work perfectly to prevent after press enter all search results disappear?, function pre(e){ e.preventDefault(); }//why i change to event, it will work perfectly to prevent after press enter all search results disappear?
swarnesh mattapalli
@mattapalliswarnesh
Oct 02 2016 05:31
how to build atribute page
Evan W
@Dirtier
Oct 02 2016 05:58
Anyone here know much about Vue.js?
grantknaver
@grantknaver
Oct 02 2016 06:05
Maybe someone out there can help me understand as to why I can't use col-sm-offset-2 (or offsets in general) for my inputs at the bottom of my website?
Richa
@richa-coder
Oct 02 2016 06:13
@Dirtier , i can help,u mainly use this library to bind ur data with DOM,i.e u donot require to explicitly manipulate the DOM,changes made to the data is reflected in the DOM.Webpack and Browserify are commonly used modules here.
Evan W
@Dirtier
Oct 02 2016 06:14
@richa-coder Yea I have a question about key modifiers
I was wondering if there was a way to make this
button v-on:click='display' value='7' 7
button value='8' 8
button value='9' 9
Richa
@richa-coder
Oct 02 2016 06:15
@mattapalliswarnesh ,what kind of attribute are u talking about? CSS attributes,magento ,wordpress?? what?
Evan W
@Dirtier
Oct 02 2016 06:15
I want the button on click to be able to pass the buttons value to my Vue method @richa-coder
is that possible?
CodeXXI
@CodeXXI
Oct 02 2016 06:15
Hey does anyone know why my forms won't let me type anything into them on CodePen? http://codepen.io/CodeXXI/pen/BLwjAb
Evan W
@Dirtier
Oct 02 2016 06:15
I tried using like 'display(7)' and stuff and couldn't get it to work
@richa-coder Oh one more thing, that HTML is in Slim btw haha forgot to mention that
@richa-coder Here's the codepen http://codepen.io/Dirtier/pen/ZpXXov
DJ
@qualitymanifest
Oct 02 2016 06:19
This message was deleted
sorry tagged the wrong person
CodeXXI
@CodeXXI
Oct 02 2016 06:19
ahh
DJ
@qualitymanifest
Oct 02 2016 06:19
@grantknaver your CSS is overriding your bootstrap, not sure what the exact problem is yet though
Richa
@richa-coder
Oct 02 2016 06:20
@Dirtier ,y don't u bind it directly using inline js?
Evan W
@Dirtier
Oct 02 2016 06:21
@richa-coder idk I'm just kind of messing around learning new frameworks
kinda figuring out whats possible ya know, that way I'll know what I can use when
if that makes any sense
I'm not even really sure if Vue is a good choice for this, I think it is but not 100%
grantknaver
@grantknaver
Oct 02 2016 06:21
@qualitymanifest thanks man
CamperBot
@camperbot
Oct 02 2016 06:22
grantknaver sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1424 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
Richa
@richa-coder
Oct 02 2016 06:22
@Dirtier ,wat are u actually looking for?
Evan W
@Dirtier
Oct 02 2016 06:23
@richa-coder what do you mean?
DJ
@qualitymanifest
Oct 02 2016 06:23
@grantknaver np. found it - it's the margin: 1px for .contactfields
Evan W
@Dirtier
Oct 02 2016 06:24
I just wanted a way to pass that value along to the method using Vue. I'm pretty sure theres a way to do it somehow
unless using in-line javascript IS the way. bc you can call the function like v-on:click='display', so I thought you'd be able to maybe pass something along to it
Richa
@richa-coder
Oct 02 2016 06:25
@grantknaver ,ur CSS and Bootstrap are not synchronized,u are overiding the properties .
Evan W
@Dirtier
Oct 02 2016 06:25
I know you can pass the $event variable, but I'm not really sure how that fits into this context
CodeXXI
@CodeXXI
Oct 02 2016 06:26
The weird thing in my case is that copying the form code to another pen works fine... it just doesn't work in the main pen
grantknaver
@grantknaver
Oct 02 2016 06:26
@qualitymanifest thank
CamperBot
@camperbot
Oct 02 2016 06:26
grantknaver sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: grantknaver already gave qualitymanifest points
Evan W
@Dirtier
Oct 02 2016 06:26
@CodeXXI Holy mother of div bro lol
grantknaver
@grantknaver
Oct 02 2016 06:26
@richa-coder ya I know. first time mixing the two...not a fan
CodeXXI
@CodeXXI
Oct 02 2016 06:26
haha yeah I guess it's a bit messy?
Evan W
@Dirtier
Oct 02 2016 06:27
lol I dont think ive ever seen that many divs
CodeXXI
@CodeXXI
Oct 02 2016 06:27
:D
well I'll see if I can clean it up later
Evan W
@Dirtier
Oct 02 2016 06:27
@grantknaver you will :P start trying to rely more on bootstrap than css, you'll fall in love like I did, promise
Richa
@richa-coder
Oct 02 2016 06:27
@grantknaver ,its okay.happens:)
Evan W
@Dirtier
Oct 02 2016 06:27
@grantknaver I used to hate the shit, like not even 2 weeks ago
DJ
@qualitymanifest
Oct 02 2016 06:29
@CodeXXI found it
@CodeXXI it's your z-index for your my-content class
CodeXXI
@CodeXXI
Oct 02 2016 06:29
oh, that interferes with forms?
DJ
@qualitymanifest
Oct 02 2016 06:30
@CodeXXI you're essentially hiding that entire div underneath body
grantknaver
@grantknaver
Oct 02 2016 06:30
@qualitymanifest are you still talking about me
CodeXXI
@CodeXXI
Oct 02 2016 06:30
oh! lol.
Evan W
@Dirtier
Oct 02 2016 06:30
z-index will interfere with anything
grantknaver
@grantknaver
Oct 02 2016 06:30
nvm lol
DJ
@qualitymanifest
Oct 02 2016 06:30
@grantknaver no, sorry, was talking to codexxi
Evan W
@Dirtier
Oct 02 2016 06:31
if you have things stacked on top of one another
CodeXXI
@CodeXXI
Oct 02 2016 06:32
Haha, thanks for finding that! That makes sense... I put the negative value in as a temp, but I guess I didn't realize / forgot that it would put it underneath the body and mess things up.
grantknaver
@grantknaver
Oct 02 2016 06:32
@qualitymanifest I just tried to remove what you suggested but I still cant use offsets?
Evan W
@Dirtier
Oct 02 2016 06:32
@CodeXXI I have a quick fix for you
in your CSS go to whatever is on top of your form
and write pointer-events:none
DJ
@qualitymanifest
Oct 02 2016 06:32
@grantknaver when i looked at it before you didn't actually have a number written in, you just had col-sm-offset... did you change that and write a number after it?
CodeXXI
@CodeXXI
Oct 02 2016 06:33
Huh. I think it also works if I just change the z-index to 0?
Evan W
@Dirtier
Oct 02 2016 06:33
Oh I thought you had the z-index's set like that for a reason
CodeXXI
@CodeXXI
Oct 02 2016 06:34
Actually I take that back. I did. I'll try the pointer-events solution
Richa
@richa-coder
Oct 02 2016 06:34
@Dirtier ,ya u can do that but a better way is to define another function (in case u have many events(onclick)) to deal with to catch the events.It will be an easier way to bind.
DJ
@qualitymanifest
Oct 02 2016 06:34
@grantknaver also it looks like you deleted your offset for your name input??
Evan W
@Dirtier
Oct 02 2016 06:35
@richa-coder how would I do that?
@richa-coder bc the other function would still have to get the value passed in from the button right?
CodeXXI
@CodeXXI
Oct 02 2016 06:35
by the way, how do I give brownie points? new to gitter
Evan W
@Dirtier
Oct 02 2016 06:35
say thanks @theirname
CamperBot
@camperbot
Oct 02 2016 06:35
:warning: could not find receiver for theirname
dirtier sends brownie points to @theirname :sparkles: :thumbsup: :sparkles:
DJ
@qualitymanifest
Oct 02 2016 06:35
@grantknaver i forked yours, the only changed i made were to delete the margin for contactFields and restore the col-sm-8 col-sm-offset-2 for your name input. https://codepen.io/qualitymanifest/pen/ozGoRz?editors=1100
Evan W
@Dirtier
Oct 02 2016 06:36
@CodeXXI like thanks @CodeXXI
CamperBot
@camperbot
Oct 02 2016 06:36
dirtier sends brownie points to @codexxi :sparkles: :thumbsup: :sparkles:
:cookie: 134 | @codexxi |http://www.freecodecamp.com/codexxi
grantknaver
@grantknaver
Oct 02 2016 06:36
thanks
Evan W
@Dirtier
Oct 02 2016 06:36
or @CodeXXI thanks
CamperBot
@camperbot
Oct 02 2016 06:36
dirtier sends brownie points to @codexxi :sparkles: :thumbsup: :sparkles:
:warning: dirtier already gave codexxi points
CodeXXI
@CodeXXI
Oct 02 2016 06:36
thanks @Dirtier
CamperBot
@camperbot
Oct 02 2016 06:36
codexxi sends brownie points to @dirtier :sparkles: :thumbsup: :sparkles:
:cookie: 242 | @dirtier |http://www.freecodecamp.com/dirtier
Evan W
@Dirtier
Oct 02 2016 06:37
no prob bob
CodeXXI
@CodeXXI
Oct 02 2016 06:37
thanks @qualitymanifest
CamperBot
@camperbot
Oct 02 2016 06:37
codexxi sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:star2: 1425 | @qualitymanifest |http://www.freecodecamp.com/qualitymanifest
DJ
@qualitymanifest
Oct 02 2016 06:37
yw :+1:
grantknaver
@grantknaver
Oct 02 2016 06:38
It is the same as I had it...sooo weird
@qualitymanifest thanks again
CamperBot
@camperbot
Oct 02 2016 06:38
grantknaver sends brownie points to @qualitymanifest :sparkles: :thumbsup: :sparkles:
:warning: grantknaver already gave qualitymanifest points
Richa
@richa-coder
Oct 02 2016 06:40
@Dirtier ,all u want is to catch the onclick events in vue.js ryt?
Evan W
@Dirtier
Oct 02 2016 06:43
@richa-coder Yes, catch the value for each individual button
@richa-coder And then I'll mess with the values once I've gotten them
just havent made it that far yet
Chris Cullen
@123xylem
Oct 02 2016 06:44
turnSeq.push(panelId);  //array ispopulated by id of panel pressed

  if (turnSeq.length <=1 || turnSeq.length > pSeq.length) {   //Pushes only new moves into playerSeq  Array after 1 move has been made.
    var removed=turnSeq.splice(10,1);        //get only the last move of the turn into player array as the SIMON game only goes up 1 move per turn
pSeq.push(removed);                                  //push that move into player array...
  };
This gives the value array[0] whjen i add it to pSeq... How come?
Richa
@richa-coder
Oct 02 2016 06:49

div id="richa">
<button v-on:click="but('1')">Hey 1</button>
<button v-on:click="but('2')">Hey 2</button>
</div>

new Vue({
el: '#richa',
methods: {
but: function (message) {
alert(message)
}
}
}) @Dirtier ,u will have to do something lyk this to catch ur values,i am not getting wat u actually wanna do with the values but probably this is wat u are looking for.U can change it according to ur requirements.

Chris Cullen
@123xylem
Oct 02 2016 06:56

function correct() {
  if (cSeq.length == pSeq.length) {// If player turn array has same turns as cpu
    for (i = cSeq.length; i >= 0; i--) {    //go through the turnsstarting from the last and count down through them both
      console.log("what correct sees", cSeq[i], pSeq[i]);   //THESE ELEMENTS COME BACK AS UNDEFINED!!!

  if (cSeq[i] != pSeq[i]) { //IF they dont match play wrong sound
        audioF['wrong'].play();   
        wasWrong = 0;
        console.log("wrong", cSeq, pSeq[i], pSeq);
        pSeq = [];
        // setInterval(lastSeq(), 8000); // Say wrong and replay last seq
        // cpuTurn = 0;   
      } else {
      //DO SOMETHING else(never gets here)
      }     }   } }

Question: why is pSeq cSeq[i] undefined in console?

$(".panel").on("click", function() {
  cpuTurn = 1;
  var panelId = $(this).attr("id");
  audioF[panelId.toLowerCase()].play(); //use id as soundfile
  $("#" + panelId).toggleClass('animate');
  //HOW DO i get this to activate and go back to default onclick?

  turnSeq.push(panelId);

  if (turnSeq.length <= 1 || turnSeq.length > pSeq.length) {
    var removed = turnSeq.splice(10, 1);
    pSeq.push(turnSeq[turnSeq.length - 1]);
  }; //Pushes only new moves into pSeq

They get their elements from the ID of the button hit
or panel hit

Evan W
@Dirtier
Oct 02 2016 06:57
@richa-coder I'm making a calculator. Each button has a 'value' like the 1 button has a value of '1'. 2 value of '2' and so on
@richa-coder So when they hit those buttons, they will be passed to the Vue methods, displayed, and then evaluated based on the operation buttons they hit such as '+' '*' '/'
@richa-coder does what you wrote actually work? Because I tried passing values into the Vue method like that a bunch of times and I can't ever get it to work
Richa
@richa-coder
Oct 02 2016 07:05
@Dirtier ya it works, provided u are preventing the defaults. or u can also send the values directly into the function and then call it later,v-on="click: get(1) ,something like this.
Evan W
@Dirtier
Oct 02 2016 07:07
@richa-coder what do you mean preventing the defaults?
Annu Nirmal
@annunirmal
Oct 02 2016 07:08
hey people, can you help me with users current city and country.
I know how to get longitute and latitute using geolocation
but help me getting exact city and country please.
Evan W
@Dirtier
Oct 02 2016 07:11
@annunirmal You have to either submit that geolocation to an API or use a lib
Annu Nirmal
@annunirmal
Oct 02 2016 07:11
@Dirtier suggest me api or library
Evan W
@Dirtier
Oct 02 2016 07:11
@annunirmal I used the js library geoplugin, if you use that it will give you lat, long, city, country, everything
it gets all the information from the user's IP address. So they dont have to give you permission either. I would suggest using that over the built in geolocation
@annunirmal the lat and long isn't from the IP though, that comes from the device's built in GPS if it has one
@annunirmal Here's everything you need to know to use it http://www.geoplugin.com/quickstart
Annu Nirmal
@annunirmal
Oct 02 2016 07:14
@Dirtier yeah you are right , i tried that and it shows some other location
@Dirtier let me try this
thanks @Dirtier
CamperBot
@camperbot
Oct 02 2016 07:14
annunirmal sends brownie points to @dirtier :sparkles: :thumbsup: :sparkles:
:cookie: 243 | @dirtier |http://www.freecodecamp.com/dirtier
Evan W
@Dirtier
Oct 02 2016 07:14
Np
Amit Patel
@AmitP88
Oct 02 2016 07:17
does this look good on your device? https://amitp88.github.io/New-Portfolio/
Evan W
@Dirtier
Oct 02 2016 07:18
@richa-coder Holy shit I got it to work. I did have to make another function. I realized the first one was targetting the 'display', so I made one that targetted the '#calc'
thanks @richa-coder
CamperBot
@camperbot
Oct 02 2016 07:18
dirtier sends brownie points to @richa-coder :sparkles: :thumbsup: :sparkles:
:cookie: 3 | @richa-coder |http://www.freecodecamp.com/richa-coder
Richa
@richa-coder
Oct 02 2016 07:19
@Dirtier , it lets u have access to original DOM events.
Evan W
@Dirtier
Oct 02 2016 07:19
@richa-coder prevent default does?
Richa
@richa-coder
Oct 02 2016 07:20
Ex:<button class="btn btn-default btn-question" v-model="selectedcategory" v-on="click: search(2,$event)" value="2">Category 2
</button>
</div>
</div>
  search: function(btn,e){
     e.preventDefault();

if(btn==1){
    //do this
}
if(btn==2){
    //do this
}

 } @richa-coder 
@Dirtier .
Evan W
@Dirtier
Oct 02 2016 07:54
@richa-coder actually now that I've gotten it to work I'm not even sure this is going to work
@richa-coder bc when I target the #calc, it makes it disappear. Idk maybe I'm not even using Vue right
Richa
@richa-coder
Oct 02 2016 07:54
@Dirtier ,it should work.
Evan W
@Dirtier
Oct 02 2016 07:55
Hold on ill show you
Sorin Ruse
@sorinr
Oct 02 2016 07:55
@Dirtier @richa-coder you can use instead of v-on="click: search(2,$event)" just @click="earch(2,$event)"
Evan W
@Dirtier
Oct 02 2016 07:55
what does that do?
Sorin Ruse
@sorinr
Oct 02 2016 07:57
its a shortcut for v-on="click"
Richa
@richa-coder
Oct 02 2016 07:58
@sorinr ,its the same
Sorin Ruse
@sorinr
Oct 02 2016 07:58
@richa-coder i know. i said it as a shortcut
Evan W
@Dirtier
Oct 02 2016 07:59
Ok so I basically have no idea how to even use Vue
if I change el to #calc
it will work, but the calculator dissappears
c0d0er
@c0d0er
Oct 02 2016 07:59
does anybody know why my css cannot be loaded in codepen? this is my code link: http://codepen.io/c0d0er/pen/RGLxpQ
Evan W
@Dirtier
Oct 02 2016 07:59
so I'm not really sure how to implement what I want....
I want it to get what I pass in from the button click event, and then display it in the #display
but every time I make a new Vue that targets the #calc to get the values, the calculator disappears. So yea, I think I'm just fundamentally missing something about Vue
Richa
@richa-coder
Oct 02 2016 08:00
@Dirtier ,u are making things complicated,just make a function to catch the values of ur buttons .
Evan W
@Dirtier
Oct 02 2016 08:01
@richa-coder lol just a normal js function? then I can't use the key modifiers right lol
@richa-coder show me an example
if you could
or are you talking about that search thing? idk how that works
Richa
@richa-coder
Oct 02 2016 08:04
@Dirtier ,no not a normal js function,keep the button as it is and then throw the values from the buttons to vue ,it will catch the values and then u can further bind those values to the calculator.
Evan W
@Dirtier
Oct 02 2016 08:05
@richa-coder I tried that, the only way I can get Vue to catch it is by targetting #calc with el: '#calc',
and when I do that it makes the whole calculator disappear
Sorin Ruse
@sorinr
Oct 02 2016 08:05
@Dirtier as @richa-coder said your are complicating ur life. here is a simple example with just 28-30 lines of js code. maybe it can be reduced by i was too lazy: calc
Evan W
@Dirtier
Oct 02 2016 08:06
@sorinr I could do this in 3 seconds with jQuery or normal javascript. The point is I want to try to use a new framework..
@richa-coder I guess I just dont understand where you want me to put this function, inside the new Vue? Or do you mean use the method like I have been?
When I use the method it wont get it without targetting the calc element
Sorin Ruse
@sorinr
Oct 02 2016 08:14
@Dirtier :+1: I like a lot vue.js but i would only use it for making "reactive" an already existing site
Richa
@richa-coder
Oct 02 2016 08:16
@Dirtier ,u will find vue.js extremely helpful when working on CMS (magento 1.x etc),it helps u fetch the values directly from DOM
@Dirtier ,i am telling u to keep ur button section as it is and then include an extra function to catch the button values which u can further use in your calc
Evan W
@Dirtier
Oct 02 2016 08:18
@richa-coder Yea but where would you put this function and how would you write it to pass it into vue?
Would you write it inside the new Vue?
Sorin Ruse
@sorinr
Oct 02 2016 08:18
@richa-coder yea. vue.js is a good alternative to tweak some CMS's
Evan W
@Dirtier
Oct 02 2016 08:18
I'm so confused
An example would be awesome
Richa
@richa-coder
Oct 02 2016 08:20
@Dirtier ,ya sure
Evan W
@Dirtier
Oct 02 2016 08:20
<3
Richa
@richa-coder
Oct 02 2016 08:20
wait
Richa
@richa-coder
Oct 02 2016 08:26
those if statements are not doing ur job? @Dirtier
Evan W
@Dirtier
Oct 02 2016 08:27
so that is the function you're talking about?
Was that search: function(btn,e) insted the new Vue({ ?
or stand-alone
Richa
@richa-coder
Oct 02 2016 08:28
ya,that is also an independent way to do it. ya
@Dirtier
Evan W
@Dirtier
Oct 02 2016 08:42
blahhh fuck it. I'm done trying lol. @richa-coder can you remind me how to write the in-line javascript
isnt it like <button value='javascript: get(7)'> ?
Richa
@richa-coder
Oct 02 2016 08:43
@Dirtier , y do u wanna learn vue? there are better frameworks out there..
Evan W
@Dirtier
Oct 02 2016 08:43
Idk I just wanted to use something. I already kind of know React, my professional web developer friend said Vue would be good for this
And apparently Vue is supposed to be easier to learn.... But I guess not
Richa
@richa-coder
Oct 02 2016 08:45
@Dirtier ,ohh! ya u can directly call in onclick.
AliFox15
@AliFox15
Oct 02 2016 09:19
How can I creat a navgation bar in this page and The horizontal line?xD
I try use position:fixed but it won't float
AliFox15
@AliFox15
Oct 02 2016 09:26
just figured that out,I should be using margin to control the nav bar..
But how can I creat that line?It's not <hr />because If you resize the page,it changes.
Artur Giniyatullin
@ArturGini96
Oct 02 2016 10:55
Hello guys. Im stuck at Random Quote Machine. I cant change quotes multiple times. It changes just ones.
In otherwords I cant write a code which changes quotes every click
Stephen James
@sjames1958gm
Oct 02 2016 10:55
@ArturGIni96 Do you have a link?
Artur Giniyatullin
@ArturGini96
Oct 02 2016 10:56
@sjames1958gm actually im null in jquery and ajax. I didnt even understand the lessons given by FFC.
@sjames1958gm Ive been trying for 2 days so I gave up and asked here.
Stephen James
@sjames1958gm
Oct 02 2016 10:58
@ArturGIni96 Your click handler does the same thing each time. the callback function for .on("click" is the click handler
What you need to do is put the quotes into and array and in your click handler compute a random index that selects from the array - that will give you a changing quote
Artur Giniyatullin
@ArturGini96
Oct 02 2016 10:59
@sjames1958gm Thanks Ill try
CamperBot
@camperbot
Oct 02 2016 10:59
arturgini96 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 3625 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Oct 02 2016 10:59
This challenge showed how to compute the random number use array.length for upper limit.
https://www.freecodecamp.com/challenges/generate-random-whole-numbers-with-javascript
@ArturGIni96 :+1: good luck
Artur Giniyatullin
@ArturGini96
Oct 02 2016 11:05
@sjames1958gm Now it prints a random quote but just once.
$(document).ready(function() {

  var quotes = ["Here is the message", "1Here is the message", "2Here is the message","3Here is the message", "4Here is the message", "5Here is the message", "6Here is the message","7Here is the message", "8Here is the message", "9Here is the message"];
var i = Math.floor(Math.random() * 10)
       $("#getMessage").on("click", function(){

      $(".message").html(quotes[i]);

    });

  });
Stephen James
@sjames1958gm
Oct 02 2016 11:05
@ArturGIni96 random number calculate inside the click handler
Artur Giniyatullin
@ArturGini96
Oct 02 2016 11:07
@sjames1958gm Oh my god, thanks. It's so simple.
CamperBot
@camperbot
Oct 02 2016 11:07
arturgini96 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: arturgini96 already gave sjames1958gm points
Amit Patel
@AmitP88
Oct 02 2016 11:07
hey guys, so I've gotten my new portfolio site pretty much to where I want it: https://amitp88.github.io/New-Portfolio/
now I want to add the typing animation on the title page to each of the project titles in each section, but I only want them to activate when the user scrolls onto that section (either via the scrolldown button or manual scroll down)
is there a way I can do this?
I know how to apply the animation to each project title, but I'm just wondering how to write the javascript code to only trigger that animation when the user is actually viewing that section of the page
Amit Patel
@AmitP88
Oct 02 2016 11:29
@scrubs767 hmmm, would this solution still work since my animation is made with jquery and not css?
Artur Giniyatullin
@ArturGini96
Oct 02 2016 11:30
@AmitP88 you can make it in jquery using jquery.css(...)
Amit Patel
@AmitP88
Oct 02 2016 11:31
@ArturGIni96 hmmm, I'll give it a shot
actually I should go to bed. it's 4:30am here, but I'll write down your suggestion and keep the suggested links open for me to revisit later
thanks for your help though guys, I really appreciate it :)
@scrubs767 @ArturGIni96 thanks :D
CamperBot
@camperbot
Oct 02 2016 11:32
amitp88 sends brownie points to @scrubs767 and @arturgini96 :sparkles: :thumbsup: :sparkles:
:cookie: 119 | @scrubs767 |http://www.freecodecamp.com/scrubs767
:cookie: 288 | @arturgini96 |http://www.freecodecamp.com/arturgini96
scrubs767
@scrubs767
Oct 02 2016 11:32
@AmitP88 when you stackexchange make sue you read all the posts, sometimes people have bugs and later post will call them out
Amit Patel
@AmitP88
Oct 02 2016 11:33
@scrubs767 lol yeah, I always read the full post just incase lol. thanks again though
CamperBot
@camperbot
Oct 02 2016 11:33
amitp88 sends brownie points to @scrubs767 :sparkles: :thumbsup: :sparkles:
:warning: amitp88 already gave scrubs767 points
Amit Patel
@AmitP88
Oct 02 2016 11:34
you all have a good night, i'ma go to bed now lol
Artur Giniyatullin
@ArturGini96
Oct 02 2016 11:35
@AmitP88 goodbuy
goodbye
Artur Giniyatullin
@ArturGini96
Oct 02 2016 11:52
<button id = "share-buttons" class=" logo">
    <a href ="https://twitter.com/intent/tweet?text=.message" target="_blank">
How can I add in a twitter share button quote's text?
Stephen James
@sjames1958gm
Oct 02 2016 11:56
@ArturGIni96 Give your <a> an id such as <a id="tweet"
In your click handler
var uriQuote = encodeURIComponent(quote)
$('#tweet').attr('href', 'https://twitter.com/intent/tweet?text=' + uriQuote);
Artur Giniyatullin
@ArturGini96
Oct 02 2016 12:03
@sjames1958gm what's uriQuote?
Stephen James
@sjames1958gm
Oct 02 2016 12:04
@ArturGIni96 In order to put the quote into the URI you have to replace all the spaces and other special characters that is what encodeURIComponent does
encodeURIComponent("this is a test!")
"this%20is%20a%20test!"
Artur Giniyatullin
@ArturGini96
Oct 02 2016 12:06
@sjames1958gm thanks a lot. Maybe I need more time to understand it. For me it's still very complicated.
CamperBot
@camperbot
Oct 02 2016 12:06
arturgini96 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 3627 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Oct 02 2016 12:07
@ArturGIni96 It will take time - there is a lot to all this
Chris Cullen
@123xylem
Oct 02 2016 12:14
http://s.codepen.io/123xylem/debug/jrAKPN
can someone help me with my CSS.. My Start button takes about a 3rd of the space in inner console as you can see if u debug it with chrome console.. How do I tidy up my inner console css?
Kieran Harding
@kieranharding
Oct 02 2016 12:45
@123xylem Why does the start buton have such big margins?
Chris Cullen
@123xylem
Oct 02 2016 12:45
@kieranharding yea i messed it up.. the margins were to positin it in the middle..
Kieran Harding
@kieranharding
Oct 02 2016 12:47
I see. I'm not sure what layout your are going for, but playing with those I was able to lay it out in a way that looks good to me.
@123xylem I haven't done this challenge yet, so I don't want to get too deep into yours and "cheat". Looks like you're well on your way, though. Have fun.
woohooAgain
@woohooAgain
Oct 02 2016 12:51
Hi, guys, i've got the following problem: in some reasons codepen.io doesn't create a window.CP object, so, when it is uses window.CP.shouldStopExecution function it is a property of undefined and i can't use foreach cycle on my object
Ashish Acharya
@anarchyrucks
Oct 02 2016 12:52
i need help in setting up css for react
jessniem
@jessniem
Oct 02 2016 14:18
Hi! Can anyone tell me where I do something wrong here:
''' $total = 0;
for ($i=0; $i < count($articles); $i++) {
  $article = $articles[$i]["item"];
  $price = $articles[$i]["price"];
  $quantity = $_POST[$i];
  $totalItemPrice = $price * $quantity;
  if ($quantity == 0) {
    continue;
  }
  ?>
      <tr>
        <td><?php echo $article ?></td>
        <td><?php echo $price ?></td>
        <td><?php echo $quantity ?></td>
        <td><?php echo $totalItemPrice ?></td>
      </tr>
    </tbody>
  </table>
<?php
// calculate total amount
$total += $totalItemPrice;
}'''
CamperBot
@camperbot
Oct 02 2016 14:18
:bulb: to format code use backticks! ``` more info
jessniem
@jessniem
Oct 02 2016 14:19
I want the result to be in a table, but only get the first item in there
Igor Amidzic
@igoramidzic
Oct 02 2016 15:17
Can someone help me with my html/css positioning?
http://codepen.io/amidzicigor/pen/rrGvdV
Why is my orange div hanging down like that?
Sorin Ruse
@sorinr
Oct 02 2016 15:26
@amidzicigor add display: flex; to your #header css style
Igor Amidzic
@igoramidzic
Oct 02 2016 15:27
@sorinr <3 thanks
CamperBot
@camperbot
Oct 02 2016 15:27
amidzicigor sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 755 | @sorinr |http://www.freecodecamp.com/sorinr
Sorin Ruse
@sorinr
Oct 02 2016 15:28
@amidzicigor welcome
Manos Mertzianis
@Litarhis
Oct 02 2016 15:29
@jessniem try to start the php code inside the tr element and echo the whole table data (td) as a string
@jessniem then close the php code just right before closing your table row
jessniem
@jessniem
Oct 02 2016 15:31
@Litarhis I'll try that :)
Manos Mertzianis
@Litarhis
Oct 02 2016 15:32
@jessniem do you want every article to be in a different row? then you have to start the php code before the tr and end it just right after the tr. and for every article you have to echo as a string the tr with the td's
@jessniem just like that
echo "<tr>" . "<td>" . $article . "</td>" . "<td>" . $price . "</td>" . "</tr>"
@jessniem so in order to be more clear, all you need to do is display your table rows using the echo of the php rather coding them directly into your html code
Igor Amidzic
@igoramidzic
Oct 02 2016 15:38
@sorinr One more question:
Why is my login button 3px from the top of the input box?
http://codepen.io/amidzicigor/pen/gwGzBQ
Manos Mertzianis
@Litarhis
Oct 02 2016 15:43
@jessniem also, you can use the foreach loop to access your articles like this
<?php 
  foreach($articles as $myVar /*e.g. $anArticle*/){
    $article = $myVar["item"];
    //rest of the code bla bla bla
  }
?>
Sorin Ruse
@sorinr
Oct 02 2016 15:51
@amidzicigor if u add align-items: center; to #loginDiv you will see the elements are all vertically centered but the button its not the same height as inputs. make them same height
Igor Amidzic
@igoramidzic
Oct 02 2016 15:54
@sorinr No worky. When I put 25px height for the button, its a lot smaller than the 25px height of the textbox
Manos Mertzianis
@Litarhis
Oct 02 2016 15:54
@amidzicigor use box-sizing: border-box; for your inputs and please let me now if that's working
Igor Amidzic
@igoramidzic
Oct 02 2016 15:56
@Litarhis Yes, that worked. Thank you
CamperBot
@camperbot
Oct 02 2016 15:56
amidzicigor sends brownie points to @litarhis :sparkles: :thumbsup: :sparkles:
:cookie: 288 | @litarhis |http://www.freecodecamp.com/litarhis

@amidzicigor may I give you a suggestion? use the global selector * and put box-sizing: border-box; like this:

* {
  box-sizing: border-box;
}

This will save you A LOT! Every element in your page will behave closer to what you want to do with it

Igor Amidzic
@igoramidzic
Oct 02 2016 16:00
@Litarhis Oh okay, thank you. That will help
CamperBot
@camperbot
Oct 02 2016 16:00
:warning: amidzicigor already gave litarhis points
amidzicigor sends brownie points to @litarhis :sparkles: :thumbsup: :sparkles:
Sorin Ruse
@sorinr
Oct 02 2016 16:05
@amidzicigor take a look at the boxmodel in devtools to see the margins and borders of the inputs and button if they have same total height
@amidzicigor they have same height now 25+2+2=29
Dalton
@dmaahs2017
Oct 02 2016 17:20
I am on the build a tribute page assignment and I am stuck trying to make my caption background underneith my photo white. I want to undo the .well effect for the caption.
https://codepen.io/maahs2017/pen/XjZYWR?editors=1000#0
Arturs Vasiljevs
@vasiljevs
Oct 02 2016 17:23
@dmaahs2017 can you correct your problem?
Farhad
@fhdhsni
Oct 02 2016 17:26

Hi. When I'm using keyup event, something like this:

searchInput.addEventListener("keyup", (e) => {
  if (e.keyCode === 13) {
    // do stuff...
  }
});

chrome says:

'KeyboardEvent.keyIdentifier' is deprecated and will be removed in M54, around October 2016. See https://www.chromestatus.com/features/5316065118650368 for more details.

How can I do the same thing without using a deprecated API?

Sorin Ruse
@sorinr
Oct 02 2016 17:26
@dmaahs2017 your pic caption already have white background
Dalton
@dmaahs2017
Oct 02 2016 17:27
@sorinr that's because im fixing it rn
Sorin Ruse
@sorinr
Oct 02 2016 17:27
@dmaahs2017 ok
Dalton
@dmaahs2017
Oct 02 2016 17:28
@sorinr how would i get it to look like this though? https://codepen.io/FreeCodeCamp/full/NNvBQW/
im not allowed to look at the code in that project though
Sorin Ruse
@sorinr
Oct 02 2016 17:43
@dmaahs2017 i would move the img inside <div class="caption well"> and add to css: img{ margin: 0 auto;}
JD Tadlock
@jdtdesigns
Oct 02 2016 17:48
@fhdhsni keyCode is still supported. Most browsers don't support the .key yet anyway. It's pretty dumb.
@dmaahs2017 The main challenge is to create a tribute page. You don't have to copy the example.
Dalton
@dmaahs2017
Oct 02 2016 17:51
@jdtdesigns So i should just style it anyway i feel anyhow i feel? I do not need to have the same styling as the example?
JD Tadlock
@jdtdesigns
Oct 02 2016 17:52
Correct @dmaahs2017
storbeck
@storbeck
Oct 02 2016 17:53
my tribute page looks nothing like the example
Dalton
@dmaahs2017
Oct 02 2016 17:53
@jdtdesigns alright thanks
CamperBot
@camperbot
Oct 02 2016 17:53
dmaahs2017 sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 631 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
storbeck
@storbeck
Oct 02 2016 17:56
here's my tribute page https://codepen.io/zoite/pen/XjrYrw
Ian Arsenault
@ianarsenault
Oct 02 2016 17:57
I'm trying to do the random quote machine, and I'm wondering where I can go to learn how to pull quote API that can be used in Codepen?
JD Tadlock
@jdtdesigns
Oct 02 2016 17:59
You can pull from pretty much any API out there @GorgonsMaze
Ian Arsenault
@ianarsenault
Oct 02 2016 17:59
Really, ok. thanks
JD Tadlock
@jdtdesigns
Oct 02 2016 17:59
Look at the example code to get an idea of how it works.
It doesn't hurt to see how they did it.
The major thing you will have to deal with is header conflicts. You will need to get jsonp from the api
Sorin Ruse
@sorinr
Oct 02 2016 18:02
@storbeck i like that bg gradient effect
JD Tadlock
@jdtdesigns
Oct 02 2016 18:03
When you have an error with the header @GorgonsMaze
storbeck
@storbeck
Oct 02 2016 18:03
thanks @sorinr
CamperBot
@camperbot
Oct 02 2016 18:03
storbeck sends brownie points to @sorinr :sparkles: :thumbsup: :sparkles:
:cookie: 756 | @sorinr |http://www.freecodecamp.com/sorinr
Ian Arsenault
@ianarsenault
Oct 02 2016 18:08
@jdtdesigns Alright thanks for the help.
CamperBot
@camperbot
Oct 02 2016 18:08
gorgonsmaze sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 632 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Islam Ibakaev
@dagman
Oct 02 2016 18:19
what is async reducer?
JD Tadlock
@jdtdesigns
Oct 02 2016 18:25
Just a api handler for redux. It handles the states of the call and allows you to do different things based on the state.
@dagman
Islam Ibakaev
@dagman
Oct 02 2016 18:27
@jdtdesigns how it differs from ordinary reducer?
@jdtdesigns does they are called async reducers because they manage async actions?
@jdtdesigns thx btw
CamperBot
@camperbot
Oct 02 2016 18:29
dagman sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 633 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
Oct 02 2016 18:30
Reducer is just the name redux gives the state handler. In vanilla, you use state numbers to determine what to output. In jquery, it's a method(.done,.success,.error,ect.) @dagman
Ryan Williams
@Ryanwfile
Oct 02 2016 18:35

Can someone please help me with a regex, I am trying to split a string matching all of these characters +-*/ when they aren't the first character of the expression. I have this so far

/\+|\-|\*|\//

but it matches all occurrences of those symbols where as I don't want a match if the symbol is at the start of the string. Thank you for any help.

JD Tadlock
@jdtdesigns
Oct 02 2016 18:43
/(?!^)[+-*\/]/g @Ryanwfile
'''(?!^)[+-*\/]'''
CamperBot
@camperbot
Oct 02 2016 18:44
:bulb: to format code use backticks! ``` more info
Ryan Williams
@Ryanwfile
Oct 02 2016 18:45
@jdtdesigns That works, thank you so much.
CamperBot
@camperbot
Oct 02 2016 18:45
ryanwfile sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 634 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
JD Tadlock
@jdtdesigns
Oct 02 2016 18:45
Sorry, on my phone lol
Dalton
@dmaahs2017
Oct 02 2016 18:48
how do i use a thumbnail image of one of my projects in html
on codepen
Manny
@Alloffices
Oct 02 2016 18:50
Can anyone Help! I'm trying to get familiar with setInterval - trying to iterate through the img array - and show the first one and then hide it and sshow the second one: http://codepen.io/aystarz52/pen/dpVjrb?editors=0010
Farhad
@fhdhsni
Oct 02 2016 18:53
@jdtdesigns gotcha, thanks :+1:
CamperBot
@camperbot
Oct 02 2016 18:53
fhdhsni sends brownie points to @jdtdesigns :sparkles: :thumbsup: :sparkles:
:cookie: 635 | @jdtdesigns |http://www.freecodecamp.com/jdtdesigns
Felix
@fzeeb
Oct 02 2016 18:59
@fhdhsni Hi, I think you can use event.key. See philc/vimium#2133
Pranay Kumar
@pranaykumar389
Oct 02 2016 18:59

Hello everybody! can any one help me with this error in Angularjs?

XMLHttpRequest cannot load file:///D:/MAIN%20PROJECT/index.html. Cross origin requests are only supported for protocol schemes: http, data, chrome, chrome-extension, https, chrome-extension-resource.(anonymous function) @ angular.js:12011
angular.js:13920 Error: [$compile:tpload] Failed to load template: index.html (HTTP status: -1 )

tyl-er
@tyl-er
Oct 02 2016 19:00

I have a css question.

img {
z-index: -1;
width: 100%;
}

.div4 {
background-color: #EFB59D;
}

.div4 img {
float: right;
width: 60%;
}

The background color is not working for div4. Not sure why. Here's the codepen. http://codepen.io/tyl-er/pen/NRGJLE

I even tried styling the Html and that did not work either.
Ian Arsenault
@ianarsenault
Oct 02 2016 19:11
@tyl-er Thats because your images are set to z-index: -1. You technically don't have any material on the page to make it so the background will show up blue. Try just typing anything in the div, and you should see the blue background show up for the content you add. Try adding this..
   <div class="div4" style="background-color:blue; position:absolute;">
Farhad
@fhdhsni
Oct 02 2016 19:16

@Alloffices

var img = [
  'https://placehold.it/350x150', 'https://placehold.it/150x150', 'https://placehold.it/350x100', 'https://placehold.it/50x150'
];

function intervalTrigger() {
  var counter = 0;
  return window.setInterval( function() {
    if(document.getElementById("imgr")) {
      document.getElementById("imgr").remove();
    }
    $("body").append('<img src="'+img[counter]+'" id="imgr"></img>');
    counter++;
    if (counter >= img.length){
      window.clearInterval(id);
    }
  }, 3000 );
};
var id = intervalTrigger();

It needs a little clean up though, but I guess it works.

@Alloffices jquery part is from your code, I don't know jquery. (but it's self-explantory)
Manny
@Alloffices
Oct 02 2016 19:19
@fhdhsni Yea I get it - thanks
CamperBot
@camperbot
Oct 02 2016 19:19
alloffices sends brownie points to @fhdhsni :sparkles: :thumbsup: :sparkles:
:cookie: 287 | @fhdhsni |http://www.freecodecamp.com/fhdhsni
Manny
@Alloffices
Oct 02 2016 19:19
I forgot about the counter as well
tyl-er
@tyl-er
Oct 02 2016 19:23
@GorgonsMaze thanks that fixed it.
CamperBot
@camperbot
Oct 02 2016 19:23
tyl-er sends brownie points to @gorgonsmaze :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @gorgonsmaze |http://www.freecodecamp.com/gorgonsmaze
jessniem
@jessniem
Oct 02 2016 19:24
@Litarhis I managed to fix it without the string, but thanks to you I figured out where I was wrong :) thanks!
CamperBot
@camperbot
Oct 02 2016 19:24
jessniem sends brownie points to @litarhis :sparkles: :thumbsup: :sparkles:
:cookie: 289 | @litarhis |http://www.freecodecamp.com/litarhis
Manny
@Alloffices
Oct 02 2016 19:36
@fhdhsni Another thing it stops after the last image i want it to loop over again
@fhdhsni i'm thinking of setting a for looping...
Manny
@Alloffices
Oct 02 2016 19:46
@fhdhsni got it working - just set counter back to 0 inside a for loop set to run infinitly
Artur Giniyatullin
@ArturGini96
Oct 02 2016 20:12
Hello guys, if I while solving challenges read documentation or stackoverflow it's cheating or not?
Jay15
@INVALID000
Oct 02 2016 20:20
i need help with javasciptr
i understand what they are trying to teach me in Understanding Case Sensitivity in Variables but idk what to do
Stephen James
@sjames1958gm
Oct 02 2016 20:22
@INVALID000 make all the variable names camelCase
@ArturGIni96 Not cheating. that is the search part of search read ask
Jay15
@INVALID000
Oct 02 2016 20:23
@sjames1958gm yes ik that but i can't figure out what they want me to do
Stephen James
@sjames1958gm
Oct 02 2016 20:24
@INVALID000 What have you tried?
Jay15
@INVALID000
Oct 02 2016 20:25
i followed the instructions perfectly but the obly value that prints out is 9000
only*
@sjames1958gm
Stephen James
@sjames1958gm
Oct 02 2016 20:25
@INVALID000 Can you post your code?
Jay15
@INVALID000
Oct 02 2016 20:25
@sjames1958gm yes im tryingto put it back the way i had it it didnt save
Islam Ibakaev
@dagman
Oct 02 2016 20:26
hey guys what the difference between async reducer and sync reducer?
Jay15
@INVALID000
Oct 02 2016 20:26
// Declarations
var Cat = 10;
var cAt = "A String";
var caT = 9000;

// Assignments
Cat = 10;
cAt = "A String";
caT = 9000;
@sjames1958gm thats my code
Stephen James
@sjames1958gm
Oct 02 2016 20:27
@INVALID000 You were supposed to modify the existing variables case, not change any of the letters.
Jay15
@INVALID000
Oct 02 2016 20:28
you mean change the values?
@sjames1958gm
Stephen James
@sjames1958gm
Oct 02 2016 20:28
@INVALID000 The 9000 is only because the last assignment is 9000
Jay15
@INVALID000
Oct 02 2016 20:29
so i need to edit the declarations?
@sjames1958gm
Stephen James
@sjames1958gm
Oct 02 2016 20:30
@INVALID000 yes, but only change the case of the existing variable
Jay15
@INVALID000
Oct 02 2016 20:31
@sjames1958gm very confused
@sjames1958gm the variables are already assigned to what they are supposed to be in the very begining
Stephen James
@sjames1958gm
Oct 02 2016 20:32
Reset the code
// Declarations
var StUdLyCapVaR;
var properCamelCase;
var TitleCaseOver;

// Assignments
STUDLYCAPVAR = 10;
PRoperCAmelCAse = "A String";
tITLEcASEoVER = 9000;
RKZoltan
@RKZoltan
Oct 02 2016 20:32
Im working on the second project. How do i make it so that when i click a button the page scrolls down to a specific point?
Stephen James
@sjames1958gm
Oct 02 2016 20:32
properCamelCase this one is correct
RKZoltan
@RKZoltan
Oct 02 2016 20:33
anyone?
Stephen James
@sjames1958gm
Oct 02 2016 20:33
Just fix the case of the variables to be camelCase
Jay15
@INVALID000
Oct 02 2016 20:33
ok
@RKZoltan i was having trouble with that too
@sjames1958gm thnx
CamperBot
@camperbot
Oct 02 2016 20:33
invalid000 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 3638 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Jay15
@INVALID000
Oct 02 2016 20:34
@RKZoltan let me get mine
RKZoltan
@RKZoltan
Oct 02 2016 20:34
@INVALID000 ty
CamperBot
@camperbot
Oct 02 2016 20:34
rkzoltan sends brownie points to @invalid000 :sparkles: :thumbsup: :sparkles:
:cookie: 129 | @invalid000 |http://www.freecodecamp.com/invalid000
RKZoltan
@RKZoltan
Oct 02 2016 20:34
oops
Stephen James
@sjames1958gm
Oct 02 2016 20:35
This is the link to <a href="#anchor">Link Text</a> put this where you want to go <a name="anchor"></a>
RKZoltan
@RKZoltan
Oct 02 2016 20:35
ty
Jay15
@INVALID000
Oct 02 2016 20:36
@sjames1958gm does this work with it being on only one page?
Stephen James
@sjames1958gm
Oct 02 2016 20:36
@INVALID000 yes, actually only works on the same page
Jay15
@INVALID000
Oct 02 2016 20:36
@sjames1958gm XD i spent waaaay to much time on this
vínαч puppαl
@vinaypuppal
Oct 02 2016 20:36

This is the link to <a href="#anchor">Link Text</a> put this where you want to go <a name="anchor"></a>

@sjames1958gm <div id="anchor"></div> this is correct way i think

Jay15
@INVALID000
Oct 02 2016 20:36
ty i had to google it XD
@sjames1958gm
CamperBot
@camperbot
Oct 02 2016 20:36
invalid000 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:warning: invalid000 already gave sjames1958gm points
Stephen James
@sjames1958gm
Oct 02 2016 20:38
@vinaypuppal I used <a name="anchor"></a>
Jay15
@INVALID000
Oct 02 2016 20:40
im having trouble typing in codecamp
vínαч puppαl
@vinaypuppal
Oct 02 2016 20:41
@sjames1958gm oh okay i don't know that we can link like this also, so i asked :+1:
Jay15
@INVALID000
Oct 02 2016 20:41
when i type it replaces the letters instead of moving them over can i fix this?
BindiBhatt92
@BindiBhatt92
Oct 02 2016 20:43
Hi I'm stuck with front end develpoment, I'm not able to add my image to website.
vínαч puppαl
@vinaypuppal
Oct 02 2016 20:44
@INVALID000 i think you have clicked Insert key on your keyboard which enabled that behaviour. so press again Insert key and check if it works as normal
RKZoltan
@RKZoltan
Oct 02 2016 20:44

<a name="anchor"></a>

it didnt work

I used AboutMe Instead of anchor
Jay15
@INVALID000
Oct 02 2016 20:45
@vinaypuppal nice ty you its very annoying XD
CamperBot
@camperbot
Oct 02 2016 20:45
invalid000 sends brownie points to @vinaypuppal :sparkles: :thumbsup: :sparkles:
:cookie: 593 | @vinaypuppal |http://www.freecodecamp.com/vinaypuppal
vínαч puppαl
@vinaypuppal
Oct 02 2016 20:46

This is the link to <a href="#AboutMe">Link Text</a> put this where you want to go <div id="AboutMe"></div> this is correct way i think

@RKZoltan try above code if you want to go to #AboutMe div

RKZoltan
@RKZoltan
Oct 02 2016 20:47
NEVERMIND IT WORKS TY
Stephen James
@sjames1958gm
Oct 02 2016 20:50
@RKZoltan :+1:
Dalton
@dmaahs2017
Oct 02 2016 21:04
how do i make navbar links actually take me somewhere on my page?
Stephen James
@sjames1958gm
Oct 02 2016 21:05
@dmaahs2017 One method is to do this
put thhis link in your navbar <a href="#anchor">Go to anchor</a> put this where you want to go <a name="anchor"></a>
Dalton
@dmaahs2017
Oct 02 2016 21:08
@sjames1958gm ohh okay, that makes sense, thanks
CamperBot
@camperbot
Oct 02 2016 21:08
:star2: 3640 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
dmaahs2017 sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
Joseph
@fendermaniac
Oct 02 2016 22:02
Hey guys. How do you center an element in the middle of a div? I've tried to use vertical-align, but it doesn't seem to work. Here's my portfolio project, i'm trying to align the element in the orange container on the left in the middle https://codepen.io/fendermaniac/pen/jrwqdK.
Jordan Bartholomew
@tourdejord
Oct 02 2016 22:04
Have you tried searching the Internet. There are many ways. Are you using bootstrap?
Joseph
@fendermaniac
Oct 02 2016 22:04
Yes sir
I have
how would you do it in bootstrap?
Jordan Bartholomew
@tourdejord
Oct 02 2016 22:05
K,
class="text-center"
in your parent div should do the trick.
Joseph
@fendermaniac
Oct 02 2016 22:05
Ok that centers the text, but I mean centering it vertically.
that would be different, right?
Jordan Bartholomew
@tourdejord
Oct 02 2016 22:06
Oh, try line-height in your CSS.
Actually. Nevermind.
For content I use:
Position: relative;
Left: n%;
Top: n%;
n represents number
vínαч puppαl
@vinaypuppal
Oct 02 2016 22:07
@fendermaniac or you can even try this
#profileimg img{
  margin: 0 auto;
}
Joseph
@fendermaniac
Oct 02 2016 22:07
ok awesome let me give that a shot, thanks
cool!
i'll tr both
Jordan Bartholomew
@tourdejord
Oct 02 2016 22:08
That's a new one Vinay. Thanks.
vínαч puppαl
@vinaypuppal
Oct 02 2016 22:08
:smile:
Joseph
@fendermaniac
Oct 02 2016 22:10
hmm, just tried both and event ended the tag with !important to override any possible overlaping css
I am in a column in the grid if that makes a difference
css can be very frustrating :)
miriam-z
@miriam-z
Oct 02 2016 22:25
I am getting the following error in the console
Failed to load resource: the server responded with a status of 404 (Not Found)
??
Stephen James
@sjames1958gm
Oct 02 2016 22:25
@miriam-z That usually means a bad url or path?
miriam-z
@miriam-z
Oct 02 2016 22:25
non of my css and js stylesheets are loading
Stephen James
@sjames1958gm
Oct 02 2016 22:26
@miriam-z Is this codepen or other?
miriam-z
@miriam-z
Oct 02 2016 22:26
@sjames1958gm I know but the paths are correct
other
<link rel="stylesheet" type="text/css" href="/bower_components/bootstrap/dist/css/bootstrap.css" />
  <link rel="stylesheet" type="text/css" href="/bower_components/font-awesome/css/font-awesome.css" />
  <link rel="stylesheet" type="text/css" href="/.tmp/app.css" />
these are my css links
Stephen James
@sjames1958gm
Oct 02 2016 22:27
@miriam-z Those are local to the same site as your webpage?
You might need ./ at the start if they are relative to your webpage
miriam-z
@miriam-z
Oct 02 2016 22:30
when I add the . in front of the slash my ide is highlighting it as an error
Stephen James
@sjames1958gm
Oct 02 2016 22:30
Hmm. "./bower_components..." ?
miriam-z
@miriam-z
Oct 02 2016 22:32
my folder structure is:
.tmp /
bower_components /
node_modules /
src /
   -client /
     -img /
     -stylesheets/
     index.html
and this is the link showing up in console
http://localhost:63342/bower_components/bootstrap/dist/css/bootstrap.css Failed to load resource: the server responded with a status of 404 (Not Found)
the same error for the rest of stylesheets also
Ken Haduch
@khaduch
Oct 02 2016 22:42
@miriam-z - if you are running on localhost and trying to refer to bootstrap in that way, you have to have that installed locally under the directory that is mentioned - I'm not familiar enough with it to know what you need to do, maybe using bower to load it? But basically you need to have that on your localhost system.
I should have scrolled up - looks like some discussion about it already.
miriam-z
@miriam-z
Oct 02 2016 22:43
@khaduch yes I am running on a localhost
Ken Haduch
@khaduch
Oct 02 2016 22:43
But it looks like you need to get bootstrap loaded under the bower_components folder, from the error message.
what does your index.html look like? or is that posted above?
miriam-z
@miriam-z
Oct 02 2016 22:43
it is under this directory
it is posted above for the links to the stylesheets
Personacode
@Personacode
Oct 02 2016 22:48
I'm building a tribute page and it's a bit intimidating. The directions say not to read the code of the example page, but wouldn't it be helpful to read it?
Ken Haduch
@khaduch
Oct 02 2016 22:48
@miriam-z - from what I can tell, you are trying to load bootstrap using this path: href="/bower_components/bootstrap/dist/css/bootstrap.css" - it does not have an http://localhost as part of the path, so it is trying to use an absolute pathname of /bower_components/ etc. Depends on what your document root directory is for this path. Now it looks like you might have /tmp in there somewhere? Have you tried to pre-pend that /tmp/bower_components etc. like that? If you put an absolute path all the way to the top level folder, that might work?
tichusp
@tichusp
Oct 02 2016 22:50
@Personacode that defeats the purpose...I would try to do something myself and check the code of the example page once i'm done to see what I could have done better
Personacode
@Personacode
Oct 02 2016 22:56
Idk where to start, but I'll think of something
DJ Pelland
@dna113p
Oct 02 2016 22:57
@Personacode Did you do all of the HTML CSS and Bootstrap challenges?
Personacode
@Personacode
Oct 02 2016 22:58
Yes
but no one remembers all of that the first time through
DJ Pelland
@dna113p
Oct 02 2016 23:01
@Personacode yeah it's understandable to get stuck in the beginning. Maybe try to start out drawing some boxes on paper and labeling the boxes with some html that you think would create that box, and the css or bootstrap info to make it look like that
miriam-z
@miriam-z
Oct 02 2016 23:05
@khaduch thanks my directory structure is above
CamperBot
@camperbot
Oct 02 2016 23:05
miriam-z sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:star2: 1746 | @khaduch |http://www.freecodecamp.com/khaduch
miriam-z
@miriam-z
Oct 02 2016 23:20
this problem is fixed now :)
:+1:
Ken Haduch
@khaduch
Oct 02 2016 23:22
@miriam-z - okay, I'm having a bit of trouble figuring out your folder structure. It is src/index.html for the HTML file? And do you have a bootstrap folder beneath bower_components? What URL do you use to actually open the index.html file within the browser? If it is localhost/src/index.html, then you might need to use ../bower_components/bootstrap/ etc., as long as you have a bootstrap folder with the bootstrap CSS under it.
@miriam-z - fixed? Okay - what did you have to do?
miriam-z
@miriam-z
Oct 02 2016 23:22
@khaduch thanks for your help but my paths are working fine now
CamperBot
@camperbot
Oct 02 2016 23:22
miriam-z sends brownie points to @khaduch :sparkles: :thumbsup: :sparkles:
:warning: miriam-z already gave khaduch points
miriam-z
@miriam-z
Oct 02 2016 23:25
it was the localhost
c0d0er
@c0d0er
Oct 02 2016 23:33
this is my screen, it doesnt load css file, does anybody know why? this is my code link: http://codepen.io/c0d0er/pen/RGLxpQ
xSnowpeltx
@xSnowpeltx
Oct 02 2016 23:33
the lessons show using javascript using <script> but in codepen.io theres a separate column for js code and im not sure how to have that affect my html
c0d0er
@c0d0er
Oct 02 2016 23:33
Capture.PNG
xSnowpeltx
@xSnowpeltx
Oct 02 2016 23:35
Also I don't really get where you find the JSONs for getJSON
Karan Bhullar
@dawnguard
Oct 02 2016 23:42
I'm doing the Random Quote Generator Project and whenever I try to use any API I get this error:
XMLHttpRequest cannot load http://quotesondesign.com/wp-json/posts?filter[orderby]=rand&filter[posts_per_page]=1&_jsonp=mycallback&_=1475451568719. The 'Access-Control-Allow-Origin' header has a value 'http://null' that is not equal to the supplied origin. Origin 'null' is therefore not allowed access.
Wayne Bunch
@waynebunch
Oct 02 2016 23:50
getJSON's callback has the data. function (data){} ...data, or whatever you decide to call it, has the the json
@dawnguard that's because you need to use ?callback at the end of your url. It is having a CORS error.
Karan Bhullar
@dawnguard
Oct 02 2016 23:55
@waynebunch That fixed it, thanks a bunch c:
CamperBot
@camperbot
Oct 02 2016 23:55
dawnguard sends brownie points to @waynebunch :sparkles: :thumbsup: :sparkles:
:cookie: 320 | @waynebunch |http://www.freecodecamp.com/waynebunch