These are chat archives for FreeCodeCamp/HelpFrontEnd

9th
Dec 2017
ehutchllew
@ehutchllew
Dec 09 2017 00:07
@linusphan I could piece it together, but I suggest going to their github page and llooking at their files.
Linus Phan
@linusphan
Dec 09 2017 00:09
I want to try to avoid looking at the source code
ehutchllew
@ehutchllew
Dec 09 2017 00:10
Why?
Linus Phan
@linusphan
Dec 09 2017 00:11
to try to come up with different solutiosn
silver537
@silver537
Dec 09 2017 00:11
Because struggling to find answers yields better reward than having the answer slapped onto the editor.
Linus Phan
@linusphan
Dec 09 2017 00:11
than what they have
im gonna try the animation property
I'll see if it works
ehutchllew
@ehutchllew
Dec 09 2017 00:12
Stepping through code is an excellent way to learn. I never said just slap it onto the editor, I said look at it. Go through it, understand it, Google the why's of it.
@linusphan Look at transitions, keyframes, and web animation API
silver537
@silver537
Dec 09 2017 00:14
Ah.. Well explain that with your answer first! >.<
ehutchllew
@ehutchllew
Dec 09 2017 00:14
Will do next time :P
silver537
@silver537
Dec 09 2017 00:15
Lol
ehutchllew
@ehutchllew
Dec 09 2017 00:20
@linusphan Just thought of a great resource. Check out Dev Tips, especially his CSS Animations playlist. The guy is awesome.
silver537
@silver537
Dec 09 2017 00:22
^ yes
Definitely
Linus Phan
@linusphan
Dec 09 2017 00:23
I think transform might work better in this case
now that I did a bit more research
I'll make a not of Dev Tips CSS animations playlist though
ehutchllew
@ehutchllew
Dec 09 2017 00:24
:+1:
Marc
@MWBauer
Dec 09 2017 01:53
Hey everyone!
Anyone know how I can clean up the weather report?
Henry
@GitHub-Henry
Dec 09 2017 02:16
@MWBauer
image.png
Marc
@MWBauer
Dec 09 2017 02:19
Yes, Henry?
You see a problem?
assasin71
@assasin71
Dec 09 2017 02:23
hi guyz
need help
xqcat
@xqcat
Dec 09 2017 02:30
Build a Tribute Page??
need help
what's the mean?
Stephen James
@sjames1958gm
Dec 09 2017 02:37
@MWBauer You have an extra ) on the last line of the function displayWeather
@assasin71 What do you need
@assasin71 Looks like you have help on another chat - good luck
Ken Haduch
@khaduch
Dec 09 2017 02:52
@MWBauer - did you get your problem fixed from :point_up: December 8, 2017 9:16 PM that post?

@MWBauer - looks like you still have that invalid code in there.

`url("${URL}")`

should probably be this:

`url(${URL})`
Ken Haduch
@khaduch
Dec 09 2017 02:57
and one other extra ) in there after the line that contains that URL code. (And those internal double quotes in the template string work out okay, I guess - it was just that extra closing paren...)
Anand Potukuchi
@anandpotukchi
Dec 09 2017 04:17
Can someone point me to a good first issue please?
Terence Mangram
@terensu-desu
Dec 09 2017 05:55

I'm pretty frustrated by this CORS error. I don't want to use jQuery to get around it, and I don't understand any of the search results I'm getting. How do I give the xhttp request the header CORS needs? I've already tried xhttp.setRequestHeader('Access-Control-Allow-Origin', '*'); but it's not working. The url in the request includes &origin=* but that isn't satisfactory. Can someone walk me through this? Here's my CodePen:

https://codepen.io/terensu-desu/pen/jaoxrW

Sweet Coding :)
@SweetCodingInc
Dec 09 2017 06:28
@terensu-desu You're almost there...
First, get rid of this line
xhttp.setRequestHeader('Access-Control-Allow-Origin', '*');
second,
you're using this to check readyState and status.. But you're using arrow function...
so this will refer to it's parent context and not xhttp context.

Just change

xhttp.onreadystatechange = () => {
    if (this.readyState == 4 && this.status == 200) {
     console.log(this.responseText);
    }
  };

to

xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
     console.log(this.responseText);
    }
  };

and it should work

if you still want to use arrow function, consider using xhttp instead of this like
xhttp.onreadystatechange = () => {
    if (xhttp.readyState == 4 && xhttp.status == 200) {
     console.log(xhttp.responseText);
    }
  };
Terence Mangram
@terensu-desu
Dec 09 2017 06:34
@SweetCodingInc Thank you! I see. I had origin=* in the url already. Thanks for the help on the arrow functions, too, I was just going around changing them and didn't remember to fix this references
CamperBot
@camperbot
Dec 09 2017 06:34
terensu-desu sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 166 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 06:34
@terensu-desu :+1:
Wiki api doesn't expect Access-Control-Allow-Origin on incoming request. It expects a url parameter specifying origin. Which you already have in your url. :)
CamperBot
@camperbot
Dec 09 2017 06:35

freeCodeCamp Wiki:

:point_right: The freeCodeCamp wiki can be found on our forum.
Please follow the link and search there.
Terence Mangram
@terensu-desu
Dec 09 2017 06:39
Yeah, I noticed that option in the API but didn't realize it until just about when you replied, lol. Of course I made it overly complicated.
Yingjie (Iris) Hu
@huyingjie
Dec 09 2017 06:58
I have a question about collapsable menu. This is an example from w3 school. https://www.w3schools.com/bootstrap/tryit.asp?filename=trybs_ref_js_scrollspy&stacked=h
When the screen is small, the menu is collapsed. When I open the menu, the menu is overlapped with the content below. How to change the code in the example from w3 school?
Terence Mangram
@terensu-desu
Dec 09 2017 07:10
Now I'm not sure how to take the JSON data and output it to HTML. I can read the response, but I can't access response.query, as it says it's undefined.
Never mind, let me go back to it. I was thinking the challenge was to load the article in the pen itself.
@huyingjie Are you saying you don't want the drop down to overlap the rest of the page? If so, just remove the nav-fixed-top class from the navbar
<nav class="navbar navbar-inverse navbar-fixed-top"> to <nav class="navbar navbar-inverse">
Yingjie (Iris) Hu
@huyingjie
Dec 09 2017 07:15
The menu should be fixed at the top. When it drops down, the following content should be pushed down, hence the content and menu should not be overlapped.
In addition: navbar-fixed-top is for bootstrap 3 whilefixed-topis for bootstrap 4.
I am using Bootstrap 4.
@terensu-desu
Terence Mangram
@terensu-desu
Dec 09 2017 07:26
@huyingjie Not sure, sorry. I got the example to work by using position: relative !important on the nav element, but then it's not fixed any longer.
Well !important isn't necessary, but just in case. Maybe on BS4 it works differently.
Yingjie (Iris) Hu
@huyingjie
Dec 09 2017 07:27
@terensu-desu Where did you put position: relative !important?
Terence Mangram
@terensu-desu
Dec 09 2017 07:28
<nav class="navbar navbar-inverse navbar-fixed-top">
Yingjie (Iris) Hu
@huyingjie
Dec 09 2017 07:28
BS4 uses a slight different way to achieve scrollspy, too
Yingjie (Iris) Hu
@huyingjie
Dec 09 2017 07:36
@terensu-desu I reproduced the w3 example using BS4. https://codepen.io/yingjiehu/pen/YEoxEJ
Yingjie (Iris) Hu
@huyingjie
Dec 09 2017 07:41
@terensu-desu After adding style="position: relative !important” to line 3 <nav class="navbar navbar-expand-sm bg-dark navbar-dark fixed-top" >, the first section is pushed down. There is one problem. If I click the menu link, the page jumps to the corresponding section but the menu bar is disappear. I got the same result with your it's not fixed any longer. with BS4.
Terence Mangram
@terensu-desu
Dec 09 2017 07:53
Ah, dang that's a shame. To be honest, I'm not sure that it's possible but then my CSS skills are limited. In order for it to stay fixed-top, I'm pretty sure it has to be position: absolute, so that it doesn't interact with the rest of the DOM elements. Making it position: relative will allow it because it's now part of the DOM structure like all the rest. I'm not sure what to look at next, but I also have to leave for a bit. Good luck!
@huyingjie
Yingjie (Iris) Hu
@huyingjie
Dec 09 2017 07:54
@terensu-desu Thank you all the same.
CamperBot
@camperbot
Dec 09 2017 07:54
huyingjie sends brownie points to @terensu-desu :sparkles: :thumbsup: :sparkles:
:cookie: 279 | @terensu-desu |http://www.freecodecamp.org/terensu-desu
Abdul-Samii Ajala Olalekan
@jalasem
Dec 09 2017 07:55

If I have a menu like this

<div class="menu active">Home</div>
<div class="menu">Help</div>
<div class="menu">Check</div>
<div class="menu">Verify</div>

how do I use pure javascript to addClass of active to any of the menu I click on and removeClass of active from others

@jalasem
Abdul-Samii Ajala Olalekan
@jalasem
Dec 09 2017 08:00
thanks @1532j0004kg
CamperBot
@camperbot
Dec 09 2017 08:00
jalasem sends brownie points to @1532j0004kg :sparkles: :thumbsup: :sparkles:
:cookie: 262 | @1532j0004kg |http://www.freecodecamp.org/1532j0004kg
Abdul-Samii Ajala Olalekan
@jalasem
Dec 09 2017 08:01
but I want pure Javascript, I can do it with jQuery too @1532j0004kg
dinesh
@1532j0004kg
Dec 09 2017 08:02
u want to add those html on the js
like u dont want to use the html side!
Abdul-Samii Ajala Olalekan
@jalasem
Dec 09 2017 08:02
no I want to toggle the classes with pure JS
dinesh
@1532j0004kg
Dec 09 2017 08:03
sry, i have no idea .
A-J Roos
@Asjas
Dec 09 2017 08:11
@jalasem Adding and removing CSS classes in Vanilla JS is done as following
element.classList.add('selected_class');
element.classList.remove('selected_class');
element.classList.toggle('selected_class');
A-J Roos
@Asjas
Dec 09 2017 08:18
What toggle does is check if the class you are specifying is already added or not. If it is, it removes it. If it hasn't been added yet it then adds the class.
TJ Hardin
@AndroidNinjaX
Dec 09 2017 08:23

Hey everyone.

I'm doing the "Pomodoro Clock" challenge, and does anyone have a good guide for adding animation? I would preffer pure CSS and JS, I am ok with jQuery and Bootstrap. I have the clock working, I would just like it to appear like the circle is counting down, or something. I swear I have been searching online and all over, but haven't found a decent guide on how to set this up. Every guide I found is not for beginners with this stuff, or uses SVG and other things.

If anyone wants to walk e through that would be welcome, however I don't expect it.

For a reference, mine right now:
https://codepen.io/AndroidNinjaX/full/GOeJxx/

Example of what I would like:
https://codepen.io/HugoGiraudel/pen/BHEwo

Abdul-Samii Ajala Olalekan
@jalasem
Dec 09 2017 08:37

Thank you all!

This how I solve it
Having a html structure like this

<div class="menu-wrapper">
      <ul>
        <li id="home-tab" class="menu-tabs">Home</li>
        <li id="insert-tab" class="menu-tabs active">Insert</li>
        <li id="layout-tab" class="menu-tabs">Layout</li>
        <li id="review-tab" class="menu-tabs">Review</li>
        <li id="other-tab" class="menu-tabs">Other</li>
      </ul>
    </div>

Here is the way I toggled class of active with pure javascript

let menuTabs = document.querySelectorAll('.menu-tabs')
console.log(menuTabs)
menuTabs.forEach(menu => {
  console.log(menu)
  menu.addEventListener('click', e => {
    menuTabs.forEach(tab => {
      tab.classList.remove('active')
    })
    e.currentTarget.classList.add('active')
  })
})
A-J Roos
@Asjas
Dec 09 2017 08:42
@AndroidNinjaX Have you checked out the Wesbos Animated Clock video on Youtube. He creates a realtime clock using Vanilla JS. You can take that same method to then countdown the animation for your clock using the time someone selects
TJ Hardin
@AndroidNinjaX
Dec 09 2017 08:50
@Asjas No I havnt, do you have a link?
dinesh
@1532j0004kg
Dec 09 2017 08:56
guys , can u please help me to learn the node.js
A-J Roos
@Asjas
Dec 09 2017 08:56
You're going to have to change it so that the circle moves instead of arms. But the basic javascript will apply I think
dinesh
@1532j0004kg
Dec 09 2017 08:56
how to learn
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 08:56
@1532j0004kg how well do you think you understand javascript?
dinesh
@1532j0004kg
Dec 09 2017 08:57
yes something!
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 08:57
node is all javascript. Unless you understand basic javascript patterns, there no point venturing into node.
TJ Hardin
@AndroidNinjaX
Dec 09 2017 08:57
@Asjas Ah thank you. I will go check it out and try to apply it to my clock
CamperBot
@camperbot
Dec 09 2017 08:57
androidninjax sends brownie points to @asjas :sparkles: :thumbsup: :sparkles:
:cookie: 313 | @asjas |http://www.freecodecamp.org/asjas
dinesh
@1532j0004kg
Dec 09 2017 08:57
@SweetCodingInc yes i knoe something in js, i want to create app .. thats y i need nodes
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 08:58
@1532j0004kg What kind of app?
you can virtually do everything with node.. It would be beneficial if you let us know what kind of app you want to build. So that we can pin point what areas of node you need to focus on
dinesh
@1532j0004kg
Dec 09 2017 08:58
like , meetings
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 08:59
meeting? Like Webex?
dinesh
@1532j0004kg
Dec 09 2017 08:59
yes
@SweetCodingInc
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:00
take a look at ExpressIO
You'll need a webserver with socket enabled
for members to chat
A-J Roos
@Asjas
Dec 09 2017 09:00
@AndroidNinjaX SVGs might still be something you need. As you need to animate the circle itself moving. You can check on how to set SVG attributes with vanilla javascript.
So if someone changes the time longer or shorter you change the SVG attribute accordingly
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:01
@1532j0004kg Also you will need VoIP support
dinesh
@1532j0004kg
Dec 09 2017 09:01
@SweetCodingInc node and express are the same use.
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:02

@1532j0004kg

Node - platform
Express - a framework that makes it easy to work with above platform

dinesh
@1532j0004kg
Dec 09 2017 09:02
another example for frame work.
TJ Hardin
@AndroidNinjaX
Dec 09 2017 09:02
@Asjas I might. I think SVG is just scary to me because I have not ever used it yet, but I might have to. I hardest thing is just finding a complete guide. I swear everything I have found so far doesn't take it to a beginner level.
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:03
Koa, Hapi @1532j0004kg
dinesh
@1532j0004kg
Dec 09 2017 09:03
what is actually frame work and platform.
please give a simple examaple!
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:04
@1532j0004kg Do you drive bike/car?
dinesh
@1532j0004kg
Dec 09 2017 09:04
bike
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:05
So bike has engine and other assembly that makes a vehicle move
your handle and brakes represent a platform... with which it's very easy to control to working of platform
imagine turning a bike to left without handle
or stopping a bike without brakes
dinesh
@1532j0004kg
Dec 09 2017 09:06
yes
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:06
framework makes it easy to work with platform
node gives you access to a lot of APIs of operating system.
but in order to use those APIs you must understand many many OS concepts...
with a framework like express, all that knowledge requirement is abstracted away and placed into framework
so that you can just focus on what matters to you and not worry about lower level implementation details like memory management, segmentation, paging etc
dinesh
@1532j0004kg
Dec 09 2017 09:09
ohhh okay i gotit
like QT is a framework for the c++ platform.
am i right
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:24
@1532j0004kg yes.. but specifically for mobile devices
A-J Roos
@Asjas
Dec 09 2017 09:36
@SweetCodingInc Qt isn't for mobile devices only. I use KDE5 on Linux and almost every single application has been written in Qt. Windows has Qt applications aswell. Yes Qt is available for mobile but it's also available for Windows, Linux and MacOS
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:37
I see...
Didn't know you can develop for desktop/laptops in qt
thanks @Asjas
CamperBot
@camperbot
Dec 09 2017 09:37
sweetcodinginc sends brownie points to @asjas :sparkles: :thumbsup: :sparkles:
:cookie: 314 | @asjas |http://www.freecodecamp.org/asjas
A-J Roos
@Asjas
Dec 09 2017 09:37
We have a linux dev who writes our applications in Qt since we target opensuse kde edition
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:39
:+1:
My final year engineering project was a mobile (symbian) app written in qt... That's all I know about it...
TJ Hardin
@AndroidNinjaX
Dec 09 2017 09:46

I feel stupid y'all. The inner circle isnt center, on this.....

https://codepen.io/AndroidNinjaX/pen/dZRqwg?editors=1100

The green one should be center inside the blue one.
And the problem is when I put margin-top: 25px and apply it to the green circle, for some reason it moved down the whole thing.
not just the green circle
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:52
@AndroidNinjaX
<div class="backCircle">
  <div class="frontCircle">
  </div>
</div>
body {
  background: black;
}

.backCircle {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background-color: blue;
  padding:25px;
}

.frontCircle {
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background-color: green;
}
TJ Hardin
@AndroidNinjaX
Dec 09 2017 09:53

@SweetCodingInc cool thank you, felt stupid. But also look at this crap. Work in my other project like I had it before lol.

https://codepen.io/AndroidNinjaX/pen/GOeJxx?editors=1100

CamperBot
@camperbot
Dec 09 2017 09:53
androidninjax sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 167 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
TJ Hardin
@AndroidNinjaX
Dec 09 2017 09:54
@SweetCodingInc and that one I have set up like
.backCircle {
  border: 1px solid white;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  background-color: blue;
  margin: 0 auto;
}

.frontCircle {
  border: 1px solid white;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background-color: green;
  margin-left: 25px;
  margin-top: 25px;
}
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:55
@AndroidNinjaX Yeah.. that would work too...

I'd just use

margin: 25px auto;

instead of

margin-left: 25px;
margin-top: 25px;
TJ Hardin
@AndroidNinjaX
Dec 09 2017 09:56
@SweetCodingInc was it because of the borders that I left out?
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 09:57
Don't think it was because of border
as you have 1px border on each of them..
so it evens out
TJ Hardin
@AndroidNinjaX
Dec 09 2017 09:59
@SweetCodingInc weird thing, it actually was. I just did it really quick to see and it went center when I have the 1px border in..... weird. Well your way is still better.
Gosh I felt so stupid there for a min
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 10:01
:D
chetanmahore
@chetanmahore
Dec 09 2017 10:04
can anyone please help me with chapter "increment-a-number-with-javascript"
please el5 this for me
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 10:06
@chetanmahore ask away
chetanmahore
@chetanmahore
Dec 09 2017 10:06
@SweetCodingInc i don't get this. i'm stuck
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 10:07
whats the challenge description?
chetanmahore
@chetanmahore
Dec 09 2017 10:07
it says "Change the code to use the ++ operator on myVar."
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 10:07
myVar++
which is equivalent to saying myVar = myVar + 1
chetanmahore
@chetanmahore
Dec 09 2017 10:09
instructions are Change the code to use the ++ operator on myVar

var myVar = 87;

// Only change code below this line
myVar = myVar + 1;

i did it this myVar = myVar++
my my i suck
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 10:13
@chetanmahore You don't need that myVar = part
just do myVar++
myVar++ includes both increment by 1 and assignment
chetanmahore
@chetanmahore
Dec 09 2017 10:14
ok it worked.
but i didn't understand this at all
@SweetCodingInc thank you
CamperBot
@camperbot
Dec 09 2017 10:15
chetanmahore sends brownie points to @sweetcodinginc :sparkles: :thumbsup: :sparkles:
:cookie: 168 | @sweetcodinginc |http://www.freecodecamp.org/sweetcodinginc
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 10:16

That's what I said

myVar = myVar + 1 can be shortened to be seen as myVar++

chetanmahore
@chetanmahore
Dec 09 2017 10:17
can this also "myVar = myVar + 1" auto increment the variable?
if used in loop
Sweet Coding :)
@SweetCodingInc
Dec 09 2017 10:18
@chetanmahore Yes. .That works in loop as well..
for(var i=0; i<10; i = i + 1){ totally valid
but I'd use for ( var i=0; i<10; i++){
chetanmahore
@chetanmahore
Dec 09 2017 10:20
okay
primuscovenant
@primuscovenant
Dec 09 2017 11:44
@heroiczero tx
CamperBot
@camperbot
Dec 09 2017 11:44
primuscovenant sends brownie points to @heroiczero :sparkles: :thumbsup: :sparkles:
:star2: 2100 | @heroiczero |http://www.freecodecamp.org/heroiczero
sehban
@sehban
Dec 09 2017 12:12
Need help!
My page goes beyond the footer
Terence Mangram
@terensu-desu
Dec 09 2017 12:22
@sehban Got a code pen link?
Marc
@MWBauer
Dec 09 2017 13:46
Morning! Anyone here?
A-J Roos
@Asjas
Dec 09 2017 13:48
@MWBauer If you need help you should post the problem and someone will help if they are available
danielfiko
@danielfiko
Dec 09 2017 13:50
Hi! I'm doing the "Repeat a string repeat a string" challenge, and my output is exactly what it's supposed to be, but it will not let me pass. Any advice?
A-J Roos
@Asjas
Dec 09 2017 13:51
Are you passing all 6 tests?
danielfiko
@danielfiko
Dec 09 2017 13:51
No
All fails
But my console output is the same as the expected result.
A-J Roos
@Asjas
Dec 09 2017 13:52
Can you post your code?
danielfiko
@danielfiko
Dec 09 2017 13:53
var repStr = "";
function repeatStringNumTimes(str, num) {
  if (num > 0) {
    for (var i = 0; i < num; i++) {
      repStr = repStr + str;
    }
      return repStr;
  }
  return "";
}

repeatStringNumTimes("*", 8);
Derp.
Tried to get it in "code format".
A-J Roos
@Asjas
Dec 09 2017 13:53
``` must be on a new line each. Just edit what you posted
I can't read that
danielfiko
@danielfiko
Dec 09 2017 13:54
Ah, thanks
A-J Roos
@Asjas
Dec 09 2017 13:55
Try switching your two return statements.
danielfiko
@danielfiko
Dec 09 2017 13:56
    }
      return "";
  }
  return repStr;
Like so?
This doesn't help
This seems like a bug. repeatStringNumTimes("abc", 4) should return "abcabcabcabc". My output: abcabcabcabc
A-J Roos
@Asjas
Dec 09 2017 13:59
function repeatStringNumTimes(str, num) {
  var repStr = "";
  if (num > 0) {
    for (var i = 0; i < num; i++) {
      repStr = repStr + str;
    }
      return repStr;
  } else {
    return "";
  }

}
that words. You should do a if else statement
danielfiko
@danielfiko
Dec 09 2017 14:02
Still fails
No, wait a minute.
A-J Roos
@Asjas
Dec 09 2017 14:02
Then you need to reset and try again
That works
danielfiko
@danielfiko
Dec 09 2017 14:03
When i declare repStr inside the function, it works.
A-J Roos
@Asjas
Dec 09 2017 14:03
That is how I typed it yes.
danielfiko
@danielfiko
Dec 09 2017 14:04
Yeah, i just copied from the if-statment and down the first time
But why does it matter if repStr is declared inside or outside the function?
A-J Roos
@Asjas
Dec 09 2017 14:04
No the var needs to be in there. I cut it from the top where you put it expressly because it needs to be inside
danielfiko
@danielfiko
Dec 09 2017 14:06
Aren't variabels always accessible from outside of function?
I just don't understand why it matters, the code outputs the exact same results now as it did the first time...
A-J Roos
@Asjas
Dec 09 2017 14:08
Why do you want to global a variable that does not need to be global? That's extremely bad coding practice....
Declare variables used inside functions inside a function. There is no need to declare it at a global level.
danielfiko
@danielfiko
Dec 09 2017 14:09
It just seemed easier there and then. But i agree with you on that point, still learning new things.
But it still should have worked when declared outside?
Marc
@MWBauer
Dec 09 2017 14:14
Morning @Asjas
Ammara
@ammusu
Dec 09 2017 14:14
Hello all
Marc
@MWBauer
Dec 09 2017 14:14
Hello
Ammara
@ammusu
Dec 09 2017 14:15
Do I need to learn PHP if I want to make Wordpress Themes from scratch?
Cristi Ciobanu
@c-ciobanu
Dec 09 2017 14:30
yes
Ken Haduch
@khaduch
Dec 09 2017 14:39
@danielfiko - the problem with declaring the variable outside of the function, in this case, has to do with the way the tests are executed. Multiple calls are made to the function, and with the variable being declared outside the scope of the function, you would have to explicitly initialize it within your function to make it work to pass the tests. It is better to keep variables as "local" as you can - having them in a global space can cause unexpected behaviors to occur when the program is being run. Always initialize, too - you cannot rely on an initial value being sensible in the context of running your code.
Ammara
@ammusu
Dec 09 2017 14:41
@c-ciobanu I have a basic understanding, but I'll put in some time to learn some intermediate stuff
@c-ciobanu Also thanks!
CamperBot
@camperbot
Dec 09 2017 14:41
ammusu sends brownie points to @c-ciobanu :sparkles: :thumbsup: :sparkles:
:cookie: 262 | @c-ciobanu |http://www.freecodecamp.org/c-ciobanu
Marc
@MWBauer
Dec 09 2017 14:50
get 'em, @khaduch
I need sudafed and ibu
brb
coffee too
Ken Haduch
@khaduch
Dec 09 2017 15:01
@MWBauer - sounds like coding essentials there... go get 'em! :)
Marc
@MWBauer
Dec 09 2017 15:57
nature break...some candy crush and kitty time
Bartek Lewandowski
@Jabarlew
Dec 09 2017 16:09
since my english is not good enough and i dont know if i understand it good could you guys tell me if i did it right or not ?
A function passed into the jQuery object runs on document.ready, which occurs after the DOM has been loaded.
Why is this useful?

External JavaScript files in the <head> of a document are generally downloaded earlier than JavaScript files included in the <body>. JavaScript files are also executed immediately at their location in the document, which means they can't access any DOM elements that come after their <script> tag in the DOM. This leads to some interesting situations.

Imagine you're building a website and you've got a script you want to run against some DOM elements in the page. If you include your script in the <head> normally, it will run as soon as it's downloaded, which will occur before the DOM has built the elements you want your script to run against. So your script wouldn't be able to do anything.

You could include your script at the bottom of the <body>, but that would mean that the download could potentially start later in the load process, slowing down the initial page render.

So what can you do?

Pass your function into the jQuery object, like so:

function someFunction() {
    // Do interesting things
}
$(someFunction)

or

$(function(){
    // Do interesting things
})

Now, you can include your script in the <head> and it won't run until the DOM has been built and the elements that you want to manipulate are on the page.

To try this technique out, I've included a zip file of a sample website in the Downloadables section. Click "Continue to Quiz" to try this technique for yourself!
Start Quiz
Quiz: $(function)

You can download the jQuery-Sample-Site.zip here.

For this quiz, can you use this script, which is linked in the of index.html, to change the boring placeholder image to a picture of a cute animal?

Remember, you'll need to pass a function into the jQuery object to run when the document is ready.

Good luck!

Note: It looks like placepuppy.it is no longer available. Here are two other image URLs that can be used:

http://placekitten.com/350/150

http://lorempixel.com/350/150/animals/

Passing a function (callback) to the jQuery object

In case you were curious, the reason you're downloading the website and running it locally instead of running it in the classroom like before is because of the way the Udacity classroom works.

With the way the <iframe> with your modified site loads in the classroom, $(someFunction)'s behavior is exactly the same as simply calling someFunction() like normal. So there isn't really a reason to ask you to try it here.
this is what i have to do
and i did that
$(document).ready(function() {
    $('img').attr('src', 'http://lorempixel.com/350/150/animals/')
});
sorry for beeing stupid :D
A-J Roos
@Asjas
Dec 09 2017 16:21
@Jabarlew Rather post that in a text sharing website. In gitter is makes all sentences one line and you have to scroll to read that. No one will be able to read taht
Use something like pastebin
Bartek Lewandowski
@Jabarlew
Dec 09 2017 16:22
yes sir
Marc
@MWBauer
Dec 09 2017 16:30
Ok...sooo.....
AJ, do you know how to clean up the weather report?
I love that I have it reporting, I'm amazed that I figured out how, but I want it to look better
Kris Baillargeon
@krisb1220
Dec 09 2017 16:35
Ohhhh
@MWBauer you're using the object itself instead of it's properties
image.png
Alex Dobre
@Zerelt
Dec 09 2017 16:36

Can anybody take a look at the new version of my site please ? I think I fixed everything that needed to be fixed, but something weird is happening on just on my pc for some reason, and only on Chrome: the images for the Extras section aren't loaded until I resize my browser. I tested it on a 15" and 13" laptops , my phone and used some other websites to test for other devices and it displays them properly.

Would like to know if the images in the Extras section are being loaded for you on Chrome without you resizing the browser (it's near the end of the webpage about 3/4 down).

https://alexander.netlify.com

Kris Baillargeon
@krisb1220
Dec 09 2017 16:36
So instead of appending the object itself to the inner html, append each object's properties via myObj.myProp
Kris Baillargeon
@krisb1220
Dec 09 2017 16:38
Holy crap @Zerelt
That's amazing
I tested on a 20" something screen and it looked great
Marc
@MWBauer
Dec 09 2017 16:38
@krisb1220 so what do I need to do?
Kris Baillargeon
@krisb1220
Dec 09 2017 16:39
Well
If I were you
I would seriously go over the Object Oriented Programming lessons
Alex Dobre
@Zerelt
Dec 09 2017 16:39
So the images in the Extras section load for you on Chrome ? @krisb1220
Kris Baillargeon
@krisb1220
Dec 09 2017 16:40
image.png
affirmative
Alex Dobre
@Zerelt
Dec 09 2017 16:40
thank you @krisb1220 ... I'm seriously considering a reinstalling windows then ... too many things acting up after the update
CamperBot
@camperbot
Dec 09 2017 16:40
zerelt sends brownie points to @krisb1220 :sparkles: :thumbsup: :sparkles:
:cookie: 303 | @krisb1220 |http://www.freecodecamp.org/krisb1220
Kris Baillargeon
@krisb1220
Dec 09 2017 16:40
What are you on?
Alex Dobre
@Zerelt
Dec 09 2017 16:41
win10
Kris Baillargeon
@krisb1220
Dec 09 2017 16:41
Win 10 is running great for me
Although I haven't updated in a good month
Alex Dobre
@Zerelt
Dec 09 2017 16:41
I don't know ... even the icons on my desktop move by themselves now when i try moving an icon sometimes
Kris Baillargeon
@krisb1220
Dec 09 2017 16:42
Ohhhh yeah there's some bugs :P
Sometimes I'll rename a file and it will rename a file in a completely different directory the same thing and delete the original
Only when its on my desktop though
Alex Dobre
@Zerelt
Dec 09 2017 16:44
or not displaying my icons at all, and had only black squares instead of icons on my desktop, had to open up every file/program that had a black square, to see the icons again ... I think the cache or something similar isn't right anymore
anyway thanks for checking if it worked. Was so sad when I checked again and saw no images just on my pc and had no idea why >_<
Marc
@MWBauer
Dec 09 2017 16:50
@krisb1220 So I was just looking over the object oriented lessons again. Do you think that I should use this.? ?
Kris Baillargeon
@krisb1220
Dec 09 2017 16:52
No
Hold on :P
Alex Dobre
@Zerelt
Dec 09 2017 16:53
I think he meant you're displaying the entire JSON object, and suggested you display just the data you wanted, by getting it like you did in that console.log console.log(json.weather[0].main.toLowerCase()) and making that show up on your page
Kris Baillargeon
@krisb1220
Dec 09 2017 16:53
The issue that you're having is that you're passing the actual JSON file's contents into the HTML file
I didn't want to hand him the answer ;)
When you call getJSON is hands you raw data via the function's arg var, json
Marc
@MWBauer
Dec 09 2017 16:55
Ok.
thanks.
Kris Baillargeon
@krisb1220
Dec 09 2017 16:55
You then need to convert that JSON into a string via JSON(a built in object).stringify (JSON.stringify(json))
Marc
@MWBauer
Dec 09 2017 16:55
You're going to say things that are absolutely right, but I won't understand.
Kris Baillargeon
@krisb1220
Dec 09 2017 16:55
That then gives you a copy of your JSON as a JSON string
That JSON string is parsable by the browser
You can convert your JSON string into a usable object via JSON.parse(jsonString)
So you would do
myObj = JSON.parse(jsonString)
AJAX and OOP are really confusing
It's a bunch of interlinking crap that really just plays off the fundamentals
Marc
@MWBauer
Dec 09 2017 16:57
which I'm trying to learn.
Kris Baillargeon
@krisb1220
Dec 09 2017 16:57
But once you understand it? Ooooooooooo it opens so much
Keep learning!
I didn't understand all of it like a month ago
then one day it clicked
Marc
@MWBauer
Dec 09 2017 16:58
So, when I report .message it gives me the stringify.json, right?
Kris Baillargeon
@krisb1220
Dec 09 2017 16:58
Yes
You need to JSON.parse() it
And assign it to an object
Then append the objects content's to .message instead of the JSON string
Because a JSON string isn't a regular string. It's not meant to be readable by humans, it's meant to be readable by the browser
It's called a JSON string because it's literally just your JSON file as a string
Marc
@MWBauer
Dec 09 2017 17:03
Ok. So.... var Weather=json.parse() ?
Kris Baillargeon
@krisb1220
Dec 09 2017 17:03
Yes
You can do everything really quickly like this
Marc
@MWBauer
Dec 09 2017 17:03
Then return Weather.
Kris Baillargeon
@krisb1220
Dec 09 2017 17:04
No
Marc
@MWBauer
Dec 09 2017 17:04
I hate this challenge.
Kris Baillargeon
@krisb1220
Dec 09 2017 17:04
That will return an object
Caaaaaaaaaaaaaaalm down
Brandon
@bd1887
Dec 09 2017 17:04
Would anyone here mind taking a quick five-question survey for my user-interface class?
First visit the website here: https://imugi.io/fish-creek-squash/
Then take the survey here: https://www.surveymonkey.com/r/Y5PMZH7
Thanks :-)
(PS The backend doesn't work since it's just a front end class)
Kris Baillargeon
@krisb1220
Dec 09 2017 17:04
It's stressful
Marc
@MWBauer
Dec 09 2017 17:04
I am calm, for now. It's just entirely too much for newbs
Kris Baillargeon
@krisb1220
Dec 09 2017 17:04
But you did a good job. It's one simple thing
No it's not
You did it
So obviously its not
There's just one fundamental that you're missing which is why I'm being so picky
Because it's a fundamental
Marc
@MWBauer
Dec 09 2017 17:05
No. I didn't. I still have a lot to do and it's been everyone else who did anything to make this work.
Fundamentals are needed
Kris Baillargeon
@krisb1220
Dec 09 2017 17:05
and not knowing it is fine, you just have to learn it is all :P
You're learning
It's called FreeCodeCamp
not My Job lol
Everyone pulls their hair out over small stuff
I'll mix up a title case and stare at it for 3 hours
Markus Kiili
@Masd925
Dec 09 2017 17:06
@krisb1220 The getJSON callback function parameter json already holds the JS object parsed from the json encoded response string (the method does it automatically). No reason to stringify and parse it in order to get the JS object.
Marc
@MWBauer
Dec 09 2017 17:07
I'm trying to look back at old code to remember how to assign an action to a button. I have the C and F buttons setup, but I need to make them DO a thing.
Kris Baillargeon
@krisb1220
Dec 09 2017 17:07
Really? Hmm
He was still stringifying the object :P
Which then had to be parsed
I didn't know that
But I was also trying to keep it as close to his solute as possible
I hate using jQuery anyways :(
@MWBauer add an event listener for when the button gets clicked, then run your logic on that event
Marc
@MWBauer
Dec 09 2017 17:09
LOL ok.
Kris Baillargeon
@krisb1220
Dec 09 2017 17:10
Also if you're trying to learn OOP and AJAX I would stray away from jQuery as it kind of eliminates the need to learn OOP for manipulating the document lol
Which is basically how I learned OOP
;p
Marc
@MWBauer
Dec 09 2017 17:10
whats oop?
Kris Baillargeon
@krisb1220
Dec 09 2017 17:10
object oriented programming
Marc
@MWBauer
Dec 09 2017 17:10
thx
Kris Baillargeon
@krisb1220
Dec 09 2017 17:11
Javascript runs on OOP. It's really really good to know, and it allows you to read and write code better.
I can't do a whole lesson here lol, but look into OOP for Javascript specifically
Marc
@MWBauer
Dec 09 2017 17:12
k. there are sites?
Kris Baillargeon
@krisb1220
Dec 09 2017 17:13
and you can't do JSON without knowing OOP
well you can
but its sooooo much harder
YouTube
Google
FreeCodeCamp
Building projects is what makes you learn
Getting down and dirty in the code
Markus Kiili
@Masd925
Dec 09 2017 17:13
@krisb1220 Javascript is actually a multi-paradigm language. You can do imperative, functional or OOP programming with it. It is not a pure functional or OOP language though.
Kris Baillargeon
@krisb1220
Dec 09 2017 17:13
But
Although not pure OOP it very much operate on OOP :P
Marc
@MWBauer
Dec 09 2017 17:15
Thank you for all of those thoughts.
So, back to weather....am I parsing?
Kris Baillargeon
@krisb1220
Dec 09 2017 17:15
I'm only speaking from experience, but once I learned OOP it made everything else make sense :P
Marc
@MWBauer
Dec 09 2017 17:15
thanks
Kris Baillargeon
@krisb1220
Dec 09 2017 17:15
Like @Masd925 said, just assign your json var to an object. It's already parsed by jQuery
Cristi Ciobanu
@c-ciobanu
Dec 09 2017 17:16
this.property works too if you don't want to assign
Markus Kiili
@Masd925
Dec 09 2017 17:16
@MWBauer You can just use json inside the callback function. It holds the object parsed from the response.
Marc
@MWBauer
Dec 09 2017 17:20
message is the object that has the information. I need to assign that to a variable? then report var?
Teo
@Teo03
Dec 09 2017 17:22
Can someone take a look at my code I'am making a simon game. everytime when it's the computer's turn I run computer() function but when that function is finished then the checkTurn() function runs the else statement instead of waaiting for the user to finish clicking on tiles. Then because of this the checkClicks() function runs and calls the checkTurn() function again, this is where the loop happens and I don't know how to fix it please help! link: https://codepen.io/Teo03/pen/yPvbwY
Markus Kiili
@Masd925
Dec 09 2017 17:22
@MWBauer If the json has a property key message that has an object as property value, you can access it by json.message. It is also possible to assign it into another variable.
Marc
@MWBauer
Dec 09 2017 17:27
I could return= json.message?
<p class=".message">
I tried <p class="json.message"> and it didn't do anything
You say if the json has a property key that has an object as property value....How do I know if I have one?
Markus Kiili
@Masd925
Dec 09 2017 17:31
@MWBauer Usually you know the structure of the JSON response. You can also get the keys of the object and loop through them etc.
Not sure what the case is here.
@MWBauer You cannot set element classes dynamically just like that. You need to do it inside the JS script.
Markus Kiili
@Masd925
Dec 09 2017 17:38
You need to find the DOM element and then append to its className property. Or use jQuery methods to do the same.
Brandon
@bd1887
Dec 09 2017 17:39
Would anyone here mind taking a quick five-question survey for my user-interface class?
First visit the website here: https://imugi.io/fish-creek-squash/
Then take the survey here: https://www.surveymonkey.com/r/Y5PMZH7
Thanks :-)
(PS The backend doesn't work since it's just a front end class)
Marc
@MWBauer
Dec 09 2017 17:44
Ya'll are speaking wise words.
For me they just don't mean anything because I don't know what it all means yet
if it helps...there ya' go
Matthew Hoth
@kingofthecross
Dec 09 2017 18:02
@brandon
Were those questions mandatory for the survey?
I ask because although all my answers were "yes" , I would not look forward to returning to the site. It's missing an "overall" question.
AbrisM
@AbrisM
Dec 09 2017 18:25
Hi all :)
Anyone familiar with using Glitch?
https://glitch.com/edit/#!/join/919998fa-2775-4209-ab86-d7d5e9aab19d I have everything here but trying to launch a live preview results in the CSS not showing nor any pictures
Here's the same file but on codepen. https://codepen.io/anon/pen/VroxeM How do I stop the page from scrolling past the footer? I've tried bottom positioning but that doesn't work
alpox
@alpox
Dec 09 2017 18:39
@AbrisM the css doesnt show because your file is called style.css but in the html you link to a file named cssfile.css
Same with the javascript where there is a name mismatch
AbrisM
@AbrisM
Dec 09 2017 18:42
Ah okay, I see it now :)
Now it's showing but not the pictures in the Glitch respitory, which is strange
AbrisM
@AbrisM
Dec 09 2017 18:48
https://codepen.io/anon/pen/VroxeM i'll stick to the codepen for now. Does anyone know how to stop the page from stretching past the footer?
Aswin Mohan
@aswinmohanme
Dec 09 2017 18:51
Hey Guys
I'm stuck
How can I implement that nav using flexbox
alpox
@alpox
Dec 09 2017 18:52
@AbrisM if you have them in the assets you most likely have to refer to the path /assets/xyz.jpg
Aswin Mohan
@aswinmohanme
Dec 09 2017 18:52
here is the nav nav
```
<nav class="main-nav"> <ul> <li><a href="#">Home<a/></li> <li><a href="#">Works<a/></li> <li><a href="#">About<a/></li> <li><a href="#">Blog<a/></li> <li><a href="#">Contact<a/></li> </ul> </nav>
.main-nav {
    display: flex;
    width: 100%;
}

.main-nav  ul {
    width: 100%;
    display: flex;
    list-style: none;
    justify-content: space-between;
}

.main-nav ul li {
    padding-right: 16px;
}
Any one ?
Tiago Correia
@tiagocorreiaalmeida
Dec 09 2017 19:00
what do you mean @aswinmohanme ?
Aswin Mohan
@aswinmohanme
Dec 09 2017 19:04
Basically I want to create a navigation bar with this look nav
using flexbox
But I don't know how to create teh empty white space between Home and Works
Here is my Markup
A-J Roos
@Asjas
Dec 09 2017 19:05
Make two flex-items home and one for the rest and use space-between
Aswin Mohan
@aswinmohanme
Dec 09 2017 19:05
 <nav class="main-nav">
                <ul>
                    <li><a href="#">Home<a/></li>
                        <li><a href="#">Works<a/></li>
                        <li><a href="#">About<a/></li>
                        <li><a href="#">Blog<a/></li>
                        <li><a href="#">Contact<a/></li>
                </ul>
            </nav>
@Asjas How ?
A-J Roos
@Asjas
Dec 09 2017 19:06
HTML.
Create a element called home and then a ul with class menu or something
And make the nav display: flex;
Aswin Mohan
@aswinmohanme
Dec 09 2017 19:07
So i have to create two ul
A-J Roos
@Asjas
Dec 09 2017 19:08
No. Why not use a <div><a>Home</a></div?
And a ul for the list-items
Aswin Mohan
@aswinmohanme
Dec 09 2017 19:10
Fixed It :D
Thanks @Asjas
CamperBot
@camperbot
Dec 09 2017 19:10
aswinmohanme sends brownie points to @asjas :sparkles: :thumbsup: :sparkles:
:cookie: 315 | @asjas |http://www.freecodecamp.org/asjas
waleed wattoo
@WaleedWattoo
Dec 09 2017 20:53
hi
i need help for my javascript code
A-J Roos
@Asjas
Dec 09 2017 20:55
@WaleedWattoo If you need help you need to post a codepen link or code with the problem you have.
waleed wattoo
@WaleedWattoo
Dec 09 2017 20:56
@Asjas disable change the content and enable restore the content using java script function
@Asjas ?????
A-J Roos
@Asjas
Dec 09 2017 20:58
@WaleedWattoo If you're going to be rude no-one is going to assist you
Someone will help you if they can
waleed wattoo
@WaleedWattoo
Dec 09 2017 20:59
@Asjas ok
how to insert hr using onclick event in javascript
AbrisM
@AbrisM
Dec 09 2017 21:15
@WaleedWattoo it might be better if you post your script/code :)
Darren
@DarrenfJ
Dec 09 2017 21:42
@WaleedWattoo here's a little vid on how to post code in here
makes it easier for people to see what you are doing
AbrisM
@AbrisM
Dec 09 2017 22:01
Speaking of code, does anyone know of any good converters that takes m4v files and turn them into mp4? I have HandBrake but it is turning certain videos into m4v instead of mp4 :)
Linus Phan
@linusphan
Dec 09 2017 23:10
im trying to have my page at a certain width
but I want the background to expand across the whole screen width
does anyone have any ideas how to do that? I've thought of padding.
But not sure if there is a nicer way of doing this
Vamp
@the-vampiire
Dec 09 2017 23:32
@linusphan can you show me an example of another page with this or draw it on a piece of paper
i cannot picture what youre asking
Moisés Man
@moigithub
Dec 09 2017 23:32
there are a background-size attribute .. set it to cover
https://www.w3schools.com/cssref/css3_pr_background-size.asp
@linusphan
Linus Phan
@linusphan
Dec 09 2017 23:33
I think I figured it out...
If anyone has time, can they please help me with this problem though.. I've been stuck on it the whole day...
        <ul class="main-ul">
          <li class="main-li"><a href="#">Title 1</a>
            <ul class="sub-ul">
              <li><a href="#">Submenu 1</a>
                <ul>
                  <li><a href="#">Submenu 1</a></li>
                  <li><a href="#">Submenu 2</a></li>
                  <li><a href="#">Submenu 3</a></li>
                </ul>
              </li>
              <li><a href="#">Submenu 2</a>
                <ul>
                  <li><a href="#">Submenu 1</a></li>
                  <li><a href="#">Submenu 2</a></li>
                  <li><a href="#">Submenu 3</a></li>
                </ul>
              </li>
              <li><a href="#">Submenu 3</a>
                <ul>
                  <li><a href="#">Submenu 1</a></li>
                  <li><a href="#">Submenu 2</a></li>
                  <li><a href="#">Submenu 3</a></li>
                </ul>
              </li>
            </ul> <!-- End sub ul-->
I'm trying to make it so when I hover over the main list item, the submenus are revealed
My CSS skills are currently lacking though
I need some help on this
Moisés Man
@moigithub
Dec 09 2017 23:35
... soo u hide the sub ul first
ul > li > ul { display:none; }
then on hover..u "display" it again
ul > li: hover ul { display: block; }
Linus Phan
@linusphan
Dec 09 2017 23:36
Here's the code again, I think I cropped some parts off by accident
      <nav>
        <ul class="main-ul">
          <li class="main-li"><a href="#">Title 1</a>
            <ul class="sub-ul">
              <li><a href="#">Submenu 1</a>
                <ul>
                  <li><a href="#">Submenu 1</a></li>
                  <li><a href="#">Submenu 2</a></li>
                  <li><a href="#">Submenu 3</a></li>
                </ul>
              </li>
              <li><a href="#">Submenu 2</a>
                <ul>
                  <li><a href="#">Submenu 1</a></li>
                  <li><a href="#">Submenu 2</a></li>
                  <li><a href="#">Submenu 3</a></li>
                </ul>
              </li>
              <li><a href="#">Submenu 3</a>
                <ul>
                  <li><a href="#">Submenu 1</a></li>
                  <li><a href="#">Submenu 2</a></li>
                  <li><a href="#">Submenu 3</a></li>
                </ul>
              </li>
            </ul> <!-- End sub ul-->

          </li> <!-- End main li 1-->


        </ul> <!-- End main ul -->
      </nav> <!-- End nav -->
the > means direct children right?
Moisés Man
@moigithub
Dec 09 2017 23:37
y
Linus Phan
@linusphan
Dec 09 2017 23:37
Sometimes when I use it, it doesn't do what I expect it to do though
okay so that code hid everything
ul > li > ul
That is targeting all the unordered lists that are direct childrens of a list item that are direct childrens of another ul
that's confusing ><
Moisés Man
@moigithub
Dec 09 2017 23:40
then use ur classes.. to be more specific
https://codepen.io/MMan/pen/wPVErO?editors=1100
Linus Phan
@linusphan
Dec 09 2017 23:41
@moigithub can you explain to me how ul > li > ul works please?
your way is more professional
Moisés Man
@moigithub
Dec 09 2017 23:41
its the same thing.. but using ul will target all ul's like u said
by using classes or id's u target specific items/groups only
Linus Phan
@linusphan
Dec 09 2017 23:43
I get that part
Moisés Man
@moigithub
Dec 09 2017 23:43
 ul > li > ul {display:none;}

.main-ul > li:hover > ul {display:block;}

.sub-ul > li:hover > ul { display:block; }
Linus Phan
@linusphan
Dec 09 2017 23:44
I was confused with since you used double arrows
and that confused me
but technically
li > ul
should work too
right?
Moisés Man
@moigithub
Dec 09 2017 23:44
yep
Linus Phan
@linusphan
Dec 09 2017 23:44
okay thanks man =) @moigithub
CamperBot
@camperbot
Dec 09 2017 23:44
linusphan sends brownie points to @moigithub :sparkles: :thumbsup: :sparkles:
:star2: 3727 | @moigithub |http://www.freecodecamp.org/moigithub
Vamp
@the-vampiire
Dec 09 2017 23:44
he never used double arrows
Linus Phan
@linusphan
Dec 09 2017 23:44
@the-vampiire yeah
Vamp
@the-vampiire
Dec 09 2017 23:44
where
Linus Phan
@linusphan
Dec 09 2017 23:47
Now, I wanna position it
so that it doesn't move everything in the page around
so I think I need to do some absolute and relative positioning
Moisés Man
@moigithub
Dec 09 2017 23:48
yep
Linus Phan
@linusphan
Dec 09 2017 23:48
im going to try it out
are you alredy a pro?
Moisés Man
@moigithub
Dec 09 2017 23:49
nope... probably i forgot all already :P been a while since i finished all
but.. lack of practice
Linus Phan
@linusphan
Dec 09 2017 23:49
you finished FCC?
Moisés Man
@moigithub
Dec 09 2017 23:49
yep.. the current map,, not beta
beta have a lot more stuff
Linus Phan
@linusphan
Dec 09 2017 23:49
DANG
How are you NOT a pro
lol
Sorry for the caps
Moisés Man
@moigithub
Dec 09 2017 23:50
lot of new shits coming out every day, keep up to date is hard
./me n00b for ever :P
Linus Phan
@linusphan
Dec 09 2017 23:50
lol
ru not actively searching for a job?
Moisés Man
@moigithub
Dec 09 2017 23:51
i am.. also hard to land one
not easy here
Linus Phan
@linusphan
Dec 09 2017 23:51
are you in the US?
Moisés Man
@moigithub
Dec 09 2017 23:51
nope.. im from Peru
Linus Phan
@linusphan
Dec 09 2017 23:51
oh..
Dang.. that's tough
How long have you been searching for?
Moisés Man
@moigithub
Dec 09 2017 23:52
yep.. depends where u live i think... 1 or 1.5 year i think
Linus Phan
@linusphan
Dec 09 2017 23:53
Oh :/
Dang
If you keep it up, and eventually land that job, I think it will just get better from there. You're already good I'm assuming, sucks that it's not that easy to land a job
Linus Phan
@linusphan
Dec 09 2017 23:58
@moigithub do you think you can help walk me through
finishing the nav please?
I've been stuck on it for hours..
like 4 maybe