These are chat archives for FreeCodeCamp/HelpFrontEnd

6th
Nov 2017
Christopher Susi
@chrisandsuch
Nov 06 2017 00:03
@gothamknight when I was young I was obsessed with planning computer games and scripting. It was clear at the time I wanted to pursue that, but my dad became really sick and there really wasn’t a way to help. I was naive but I thought at the time I could learn more about medicine to help him.
iso
@iso1048
Nov 06 2017 00:06
@chrisandsuch I see - that is always a powerful motive. I also started out wanting to do med - I still do, but after doing my BSc, I am thinking about doing engineering since I miss designing and creating things (and maths).
@chrisandsuch have you looked at taking online computer science courses?
Christopher Susi
@chrisandsuch
Nov 06 2017 00:09
@gothamknight thats exactly what I miss about it. I have a couple schools I’m interested in that will give me a shot at it.
iso
@iso1048
Nov 06 2017 00:11
@chrisandsuch awesome
Christopher Susi
@chrisandsuch
Nov 06 2017 00:11
@gothamknight Do you have any suggestions or courses you recommend?
@chrisandsuch so have you graduated?
@chrisandsuch https://gothamknight.github.io/nucleotide-sequence-translator/ I made this a while back - you are the only other person I know (on this chat) who studied health science, so you would understand its use.
Bello Abdulhakeem
@BolajiZ
Nov 06 2017 00:29
https://codepen.io/BolajiZ/pen/eGQwON/?editors=1100 i am currently working on my portfolio page, the background image on my pageThree keeps overshadowing the background image on my pageTwo
Christopher Susi
@chrisandsuch
Nov 06 2017 00:42
@gothamknight Wow thank you for the resources! I’ll definitely give these a look soon.
CamperBot
@camperbot
Nov 06 2017 00:42
chrisandsuch sends brownie points to @gothamknight :sparkles: :thumbsup: :sparkles:
:cookie: 461 | @gothamknight |http://www.freecodecamp.com/gothamknight
Christopher Susi
@chrisandsuch
Nov 06 2017 00:45
@gothamknight I did graduate with a Bachelor in Science in 2011. Went through the medical school application process (mcat, letters of rec, experience, interviews). Decided on a graduate biomedical program, but it didn’t work out for me.
iso
@iso1048
Nov 06 2017 00:52
@chrisandsuch oh true. So are you working at the moment or focusing on comp sci?
Christopher Susi
@chrisandsuch
Nov 06 2017 00:53
@BolajiZ I would check your classes or mabey add <div class=“row”>?
@gothamknight not working at the moment. focusing on comp sci and trying to figure out whats best for me. Trying to understand debt and finances before I take more on with school loans.
@gothamknight also interested in building out some ideas I have for projects with code.
Bello Abdulhakeem
@BolajiZ
Nov 06 2017 00:58
@chrisandsuch i did the page three still covers the page 2
iso
@iso1048
Nov 06 2017 01:18
@chrisandsuch yeah that is what I need to do too.
dinesh
@1532j0004kg
Nov 06 2017 05:26
guys i have one dought

$(document).ready(function(){

$("button").click(function(){
getQuote();
});

function getQuote(){
$.getJSON("https://api.forismatic.com/api/1.0/?method=getQuote&key=457653&format=jsonp&lang=en&jsonp=?",
function(quote){
$(".displayBox").text(quote.quoteText);

});

}
});

how to make the quote fadein?
A-J Roos
@Asjas
Nov 06 2017 05:34
@1532j0004kg You will have to create a class in css with a transition. You will then apply the class once someone clicks the button and then remove the class afterwards
dinesh
@1532j0004kg
Nov 06 2017 05:48
how to add the transition.
where i want to add the transition?
You create a css class. But you assign it in javascript. Not in the html part
dinesh
@1532j0004kg
Nov 06 2017 05:52
ok
by using fadeIn(); in js we can able to do?
A-J Roos
@Asjas
Nov 06 2017 05:53
You can use that too
Max Voronov
@maxv
Nov 06 2017 06:02
@1532j0004kg You can also use :
https://daneden.github.io/animate.css/
If you want to get extra animations
Nikhil Singh
@nikhilmufc7
Nov 06 2017 07:54
Has anyone got any experience using particles.js before? I am looking to use it for recreating my portfolio
Dan Couper
@DanCouper
Nov 06 2017 08:50
@1532j0004kg animate works in non-Microsoft browsers as well, eg document.querySelector('.displayBox').animate([{ opacity: 0 }, { opacity: 1 }], 1000); (where the first argument is an array of transitions that the animation goes from -> to, and the second argument is either the duration, or an object with more specific options). If you're using jQuery anyway, you can do it entirely through that, but either way you don't necessarily have to use CSS
Jake
@JakeDVirus
Nov 06 2017 09:04

In the following code below, the media query condition is mentioned in two instances inside the source element.

1- in the media attribute
2- in the sizes attribute

The following code is from this article https://www.sitepoint.com/how-to-build-responsive-images-with-srcset/

<picture>
<source media="(max-width: 700px)" sizes="(max-width: 500px) 50vw, 10vw"
srcset="stick-figure-narrow.png 138w, stick-figure-hd-narrow.png 138w">

<source media="(max-width: 1400px)" sizes="(max-width: 1000px) 100vw, 50vw"
srcset="stick-figure.png 416w, stick-figure-hd.png 416w">

<img src="stick-original.png" alt="Human">
</picture>

I am curious what is the logical reason behind using the media query condition in the mentioned two instances when it could be done in one instance (in media attribute). Isn't it redundant?

Dan Couper
@DanCouper
Nov 06 2017 09:12

What the author is doing is making the sizing very specific - in this case it's not redundant because:

  1. viewport under 700px, first source is true, so browser will look at that one, and only download that image. then if the viewport is below 500px, it'll use the first size, otherwise the second size - same image though.
  2. viewport under 1400px, second source is true, and browser downloads that image, then does the sizing thing for that.
  3. if not supported, or over 1400px, use the fallback.

So the author is just making it v granular. The media will decide which image is downloaded, the size provides constraints re sizing that image (it's still the same image though)

It would be redundant only if the media queries in size were the same as the ones in media - then having different source attrs would be more sensible
alpox
@alpox
Nov 06 2017 11:12
@tiagocorreiaalmeida Hio, around now :D
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 11:16
got it solved before going to sleep yesterday, using apis or things created by others some times can be confusing :smile:
linkin-park
@linkin-park
Nov 06 2017 11:16
hi pox
alpox
@alpox
Nov 06 2017 11:16
@tiagocorreiaalmeida Yea it can :D
@linkin-park Hio, i'm not pox :D
And i don't have pox!
linkin-park
@linkin-park
Nov 06 2017 11:18
since its alpox , which is 'all pox ' so called you as pox
alpox
@alpox
Nov 06 2017 11:23
@linkin-park Its not all pox :D
linkin-park
@linkin-park
Nov 06 2017 11:25
what is @alpox - assuming =: your native name?
alpox
@alpox
Nov 06 2017 11:26
Is not my normal name, its just an internet acronym
linkin-park
@linkin-park
Nov 06 2017 11:27
native interntet acronym name ? :)
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 11:48
@alpox my I pm you? not related to programming exactly more about an opinion
korzo
@korzo
Nov 06 2017 11:50
@linkin-park Hi. How was your interview?
linkin-park
@linkin-park
Nov 06 2017 11:55
well the interview was good in the end i screwed up :)
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 11:57
how did you screwed up?:D
linkin-park
@linkin-park
Nov 06 2017 11:57
i'm in dilemma should i move to full stack js - this would take time or front end reactjs dev ? @korzo
alpox
@alpox
Nov 06 2017 11:59
@tiagocorreiaalmeida Sure just pm me :D
Sry was eating
buiphuking
@buiphuking
Nov 06 2017 12:04
this web
www.histography.io
the ruler at the bottom, drag to the right, web zoom in, drag to the left, web zoom out,
how to do that?
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 12:05
Im using something called highcharts it does something close to that but im pretty sure that's not they used there tough
@buiphuking http://histograph.io
Nikola
@n1x1
Nov 06 2017 12:08
da li ima neko sa nasim govornim podrucjem, imam pitanje.
korzo
@korzo
Nov 06 2017 12:10
@linkin-park well, to master full stack will take a lot of time. I think it's better to master front-end, add react to your skill set and then start with backend
linkin-park
@linkin-park
Nov 06 2017 12:15
master ? i'm not interested to master :)
atleast to build basic app ?! @korzo
korzo
@korzo
Nov 06 2017 12:20
@linkin-park I'm not sure if 'build basic app' is enough to land a job.
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 12:20
@linkin-park try to start the backend projects of fcc
and see where it takes you
you dont lose nothing in doing it so
linkin-park
@linkin-park
Nov 06 2017 12:27
i'm from different stack to js , so nothing changed only the language , framework and libs changed , everything remains as it is :) @korzo
Long Nguyen
@longnt80
Nov 06 2017 12:30
@linkin-park what is your goal?
if you have a goal, you would know what to learn
hakanpekel
@hakanpekel
Nov 06 2017 12:35
Hi. I am working on html forms using javascript. I want to save entered data save to txt file client server side. I want to save txt file C local disk and don't ask the where do you save. Automatically add entered data new line and sava txt file fixed name. How can i do this?
linkin-park
@linkin-park
Nov 06 2017 12:35
@longnt80 to make money :)
yes i know sir :)
Long Nguyen
@longnt80
Nov 06 2017 12:42
Then
Markus Kiili
@Masd925
Nov 06 2017 12:44
@longnt80 It must feel nice to be called Sir Long Nguyen. Warhorse and lance and the wind in your face...
Nikola
@n1x1
Nov 06 2017 12:59
Hi guys, I finished my tribute page on FreeCodeCamp on task 111, now I have to write a user story and am a bit confused by it...can someone with experience help me ?
and is this necesery to proceed?
mstellaluna
@mstellaluna
Nov 06 2017 13:01
@n1x1 the tasks aren't numbered.. those are the number of points you have. The tribute page must meet the user stories which is the requirements. Each project has them and needs to fullfil them.
Nikola
@n1x1
Nov 06 2017 13:02
@mstellaluna do I have to create a link on tribute page for it?
mstellaluna
@mstellaluna
Nov 06 2017 13:03
these are the two requirements
image.png
Long Nguyen
@longnt80
Nov 06 2017 13:05
@Masd925 :D
mstellaluna
@mstellaluna
Nov 06 2017 13:07
if you did those, then you have to provide the link to your project so the final product and code can be reviewed when you click on completed project
Jacob G.
@JakeZ1
Nov 06 2017 13:08
Hello.
I need a bit of help, I am trying to get a navbar on my website with boostrap but it hasnt seem to be working. Been at if for the last day or two. I dont know if I have bootstrap installed incorrectly or what. The text-primary works so you figure bootstrap would too although here is what im getting http://prntscr.com/h6vqoy/direct. And it should look like this http://prntscr.com/h6vr0d/direct. Here is my current code. https://pastebin.com/cV88L0XN Any help would be appreciated.
Brandon Blackwell
@Radlerz1
Nov 06 2017 13:31
Hey guys, I've been working on a project but came to a stop cause I can't wrap my head around something. It has to do with mongodb and mongoose. I know this isn't the room for this question. but If someone could pm me if they are experienced with mongodb and mongoose that would be much appreciated!
A-J Roos
@Asjas
Nov 06 2017 13:34
@JakeZ1 It might be your bootstrap files. I just copied your code into codepen and imported the bootstrap 4 css & js files and the navbar works
salwame
@salwame
Nov 06 2017 13:34
hi..can someone please help me what am i doing wrong with my code here
A-J Roos
@Asjas
Nov 06 2017 13:34
@JakeZ1 https://codepen.io/asjas/pen/zPBjVB you can test here
salwame
@salwame
Nov 06 2017 13:34
<img class="smaller-image thick-green-border" src="https://bit.ly/fcc-relaxing-cat" alt="A cute orange cat lying on its back. ">
.thick-green-border: {
border-width: 10px;
border-style: solid;
border-color: green;
}
Brandon Blackwell
@Radlerz1
Nov 06 2017 13:36
why is there a : after thick-green-border?
salwame
@salwame
Nov 06 2017 13:38
okay and that's my mistake! thank you :)
@Radlerz1
Jacob G.
@JakeZ1
Nov 06 2017 13:38
Thanks. Ill try to throw it up on a server. I only had the min.css in the directory which may be it.
Brandon Blackwell
@Radlerz1
Nov 06 2017 13:38
No problem ;)
Jacob G.
@JakeZ1
Nov 06 2017 13:39
Quick question. When you use bootstrap do you just install all of the css/js files even if you dont link them in the html?
A-J Roos
@Asjas
Nov 06 2017 13:40
No
You don't
Jacob G.
@JakeZ1
Nov 06 2017 13:41
Alright, yea im not sure where the problem comes in. Im using the v4.0.0-Beta.2 yet im getting this issue. Would you guys thing I should try the CDN or a diffrent method?
think
A-J Roos
@Asjas
Nov 06 2017 13:41
You can test
I use static files myself
@JakeZ1 If you want the navbar to display and then collapse into a button you need to change the class navbar-toggleable-md to navbar-expand-lg
The class is forcing a button to display even at large sizes.
You can check that same codepen and resize it.
Nehemiah Kivelevitz
@NehemiahK
Nov 06 2017 13:56
Hey guys. I'm working on my quote generator. I'm having a lot of issues getting the divs to stay the right size.
Any reccomendations to not have the divs mess up?
Tom
@moT01
Nov 06 2017 13:58
@NehemiahK tough to say what you should do with that info, but there's some max-width and max-height properties in css that might help
Niloy513
@Niloy513
Nov 06 2017 14:04
@NehemiahK A good rule with sizing with css is to always define the properties of every tag you have to avoid nesting issues and to usually always use units that are dynamic, like percentage, rem, vh, vw, etc
Aside from the fact that I didn't stlye it yet. I want to really have the quote in a div. and for the quote button not to move around
Niloy513
@Niloy513
Nov 06 2017 14:17
it's best to display your code on codepen or something so people can test it live. but if you want the quote button to not move around then I suggest just positioning the button with css with vh and vw for that case.
v stands for viewport meaning it doesn't care about nesting it will go the size of the view port, for a quick fix.
wnghero
@wnghero
Nov 06 2017 14:47
var Bike = function() {

  // Only change code below this line.
  var gear = 0;
  this.setGear = function(change){
    gear += change;
  };
  this.getGear = function(){
    return gear;
  };
};
  var myCar = new Car();
  var myBike = new Bike();
why isnt bike.getGear returning 3 after bike.setGear(3)?
gaitchs gangmei
@gaitchs
Nov 06 2017 14:49
need help with php countdown timer
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 14:50
@wnghero
wnghero
@wnghero
Nov 06 2017 14:53
@tiagocorreiaalmeida i have to do 3 numbers in a row i think its adding them together how do i avoid that?
like bike.setGear(3) bike.setGear(4) bike.setGear(5)
A-J Roos
@Asjas
Nov 06 2017 14:55
@wnghero You don't use bike.setGear(), you use myBike.setGear()
You declare a new var myBike
wnghero
@wnghero
Nov 06 2017 14:56
i know i typed it wrong oops
A-J Roos
@Asjas
Nov 06 2017 14:58
@wnghero That is how it should work. You need to set the gear to 3, 4, 5. It's shouldn't add 4 to 3
Every call is a new function that is run. It does not add the gear 3 to gear 4 to make gear 7
wnghero
@wnghero
Nov 06 2017 15:01
yeah thats what I thought its saying "myBike.setGear(4)" is working but then "myBike.setGeat(3)" and "myBike.setGear(1)" isnt returning the right number when you call getGear
Sorin Ruse
@sorinr
Nov 06 2017 15:03
@wnghero yoy have to let this function var Bike = function() accept parameters like var Bike = function(change)
wnghero
@wnghero
Nov 06 2017 15:04
ahh ok let me try thank you
@sorinr that didnt work
wnghero
@wnghero
Nov 06 2017 15:18
So i figured out its adding them for some reason anyone know why?
Koohyar Movassagh
@Koohyar-m
Nov 06 2017 15:38
Hi guys, I am solving Smallest common mutiple challenge , can calculate least common mutiple of two small numbers (e.g 90, 80 for) but bigger numbers (318780, 201894) gives the wrong answer ! I used while loop to find the Greatest Common Divisor then use that to find LCM. https://codepen.io/Codeconnect/pen/yPJjmL?editors=0012
korzo
@korzo
Nov 06 2017 15:44
@ConnectCodes try to add
// noprotect
as first line at FCC
@ConnectCodes you have missing assignment on line 8
Koohyar Movassagh
@Koohyar-m
Nov 06 2017 15:47
@korzo noprotectas first line in FCC? but all my code is in codepen now
@ConnectCodes missing assignment, means I should make a new variable and assign it to some value? this line you mean? b = a % b;
korzo
@korzo
Nov 06 2017 15:50
@ConnectCodes
a % b;
does nothing
@ConnectCodes so you have to assign it to some variable.
Koohyar Movassagh
@Koohyar-m
Nov 06 2017 15:56
@korzo I see I removed it and now I get the correct answer, strange
function test() {

var a = 90;//318780;
var b = 80;//201894;
var ab = a * b;
  while(a % b !== 0) {
      b = a % b;
    }
  return ab/b;// ab/b
}
console.log(test());
korzo
@korzo
Nov 06 2017 15:57
@ConnectCodes but your algorithm is wrong
tptynlr
@tptynlr
Nov 06 2017 16:01
what is the meaning of template in Angularjs?
HTML with additional markup is Template.
Koohyar Movassagh
@Koohyar-m
Nov 06 2017 16:02
@korzo little confused I want while to repeate a % b untill the condition is not true (a%b!=0). I dont undrestnd why I need another varianle ?
alpox
@alpox
Nov 06 2017 16:14
@tptynlr A template is html which is not yet instantiated this means its only a blueprint with no data, but rules for how to render/build the html when it gets data.
A template can be instantiated multiple times and rendered with different data.
Stephen James
@sjames1958gm
Nov 06 2017 17:36
@ConnectCodes a%b without assignment doesn't change anything so a%b will never change.
Tony Brackins
@mrbrackins
Nov 06 2017 18:21
@kbaig you familiar with local storage using React Native?
Kaz Baig
@kbaig
Nov 06 2017 18:26
@mrbrackins Haven't used Native sorry
GabriRa
@GabriRa
Nov 06 2017 18:27
I have a string like "<div class="1"> </div>", how can I convert directly that string in a HTML container?
Kaz Baig
@kbaig
Nov 06 2017 18:28
@GabriRa You want to insert <div class="1"> </div> into an html element?
Are you using regular JS or jquery
GabriRa
@GabriRa
Nov 06 2017 18:30
Regular js
Kaz Baig
@kbaig
Nov 06 2017 18:30
Did I understand your question correctly or no
GabriRa
@GabriRa
Nov 06 2017 18:31
But I dont want to use document.querySelector("1").innerHtml = x
yes, I want to introduce that into a container, I was wondering if there is another way
Kaz Baig
@kbaig
Nov 06 2017 18:31
Why not?
GabriRa
@GabriRa
Nov 06 2017 18:31
into an html elemnt
Kaz Baig
@kbaig
Nov 06 2017 18:32
Why do you not want to do it that way?
GabriRa
@GabriRa
Nov 06 2017 18:32
Because I am using React+Redux and its a class without logic, so I can't use componentDidMount or somehting similar
Because that string comes from a call
They already helped me with this link, but hanks !https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
Ivan Ngundela
@ingundela
Nov 06 2017 18:42
Hi everyone, I'm busy making some changes to my portfolio website and need some help, I want to change the defaul bootstrap navigation hover color from white to yellow same as my ingundela, I coulf find a way to change the active nav-item to the yellow color but what I actually wanto is to make it yellow only page loads and once the user starts moving to different section the yellow moves to the section item like About Me, Services Portfolio and Contact. the link to the updated portfio is https://ingundela.github.io/portnew/ Thanks in advance
Kaz Baig
@kbaig
Nov 06 2017 18:51
@ingundela looks like the .active class is controlling the color
Ivan Ngundela
@ingundela
Nov 06 2017 18:53
@kbaig I want the yellow to move to about when moving to the next section... even if I remove the .navbar .collapse .navbar-nav .nav-item.active a{
color: #FDCD3B !important;
font-weight: 600;
}
it do not help
@kbaig actually when scrolling Home keeps active
Kaz Baig
@kbaig
Nov 06 2017 18:57
Home isn't keeping active when I scroll to a different section as far as I can tell
Ivan Ngundela
@ingundela
Nov 06 2017 19:00
@kbaig when you scroll does the color yellow goes movies to the next item? pleaese check I've just removed .navbar .collapse .navbar-nav .nav-item.active a{
color: #FDCD3B !important;
font-weight: 600;
} so that I don't have any hover cover to the active .. to see how it look ... it keep bold white... in Home and also on the other items
Ivan Ngundela
@ingundela
Nov 06 2017 19:37
Please help
korzo
@korzo
Nov 06 2017 19:43
@ingundela
#navbarNav .nav-link.active {
    color: #FDCD3B;
}
Renan Teixeira Ferraz
@RTFerraz
Nov 06 2017 19:46
Hi there
Ivan Ngundela
@ingundela
Nov 06 2017 19:47
@korzo Thanks you a lot
CamperBot
@camperbot
Nov 06 2017 19:47
ingundela sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
:cookie: 750 | @korzo |http://www.freecodecamp.com/korzo
Ivan Ngundela
@ingundela
Nov 06 2017 19:47
@korzo but my Home still has bold white when I start scroling to other section ... how to I remove it?
korzo
@korzo
Nov 06 2017 19:49
@ingundela because parent li element of "Home" link has also class active. Remove it
Ivan Ngundela
@ingundela
Nov 06 2017 19:51
@korzo THANK YOU
CamperBot
@camperbot
Nov 06 2017 19:51
ingundela sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
api offline
Ivan Ngundela
@ingundela
Nov 06 2017 19:52
@korzo defi
Onome Sotu
@onomesotu
Nov 06 2017 19:52
Hello Hackers
Hi @korzo
korzo
@korzo
Nov 06 2017 19:52
@ingundela glad to help
@onomesotu Hi
Onome Sotu
@onomesotu
Nov 06 2017 19:53
I am trying to get the value of a span element
Ivan Ngundela
@ingundela
Nov 06 2017 19:53
@korzo Definitely not easy to learn Web development.. you on my own.. but I know I can count on you guys..
Onome Sotu
@onomesotu
Nov 06 2017 19:53
To change my temperature units
here is the code
<div id="main">
        <div class="container text-center">
            <div class="row">
                <div class="col-sm-8 weather_main">
                    <h1 class="city">Helsinki</h1>
                    <h3 class ="description">Mostly Cloudy. Wind Speed</h3>
                    <h2 class="degree"><span class="temp">15</span>&deg;<span class="unit">C</span></h2>
                </div>
                <div class="col-sm-4 weather_info">
                    <p class="wind">Wind Speed:</p>
                    <p class="pressure">Pressure:</p>
                    <p class="humidity">Humidity:</p>
                    <p class="sunrise">Sunrise:</p>
                    <p class="sunset">Sunset:</p>
                </div>
            </div>
        </div>    
    </div>
Here is the Jquery
$('.temperatureUnit').on('click', function(){
        var temperatureUnit = $('.degree .unit').text();
        if(temperatureUnit === 'C'){
            $('.unit').html('F');
            $('.temp').html(celsiusToFahrenheit());
        }else if(temperatureUnit === 'F'){
            $('.unit').html('C');
            $('.temp').html(fahrenheitToCelcius());
        }
    });
Ivan Ngundela
@ingundela
Nov 06 2017 19:55
@korzo There is something very nice I see in website.. like having transparent navigation, but when I start scrolling the background color appear, like now I have back as navigation background.. I want to have ti transparent and only apper the black background when the end the hero picture... how can I achive that?
Onome Sotu
@onomesotu
Nov 06 2017 19:56
the class 'temperatureUnit' is a button
This could should work, but it doesnt
I tried logging the var temperature unit but it doesn't log anything
korzo
@korzo
Nov 06 2017 19:59
@onomesotu do you have it on codepen?
Onome Sotu
@onomesotu
Nov 06 2017 20:00
lool.. nope :(
Kaz Baig
@kbaig
Nov 06 2017 20:00
can you put it in one
Onome Sotu
@onomesotu
Nov 06 2017 20:00
Oh boy lemme see..
korzo
@korzo
Nov 06 2017 20:02
@ingundela it usually done by checking position of viewport on scroll and compare it to hero image.
If viewport is at desired position, you toggle some class on navigation to change background
Stephen James
@sjames1958gm
Nov 06 2017 20:04
@onomesotu Have you tried using console to see if $('.degree .unit') selects the element you want?
Is there any other element with the class unit? If not then just use $('.unit')
Ivan Ngundela
@ingundela
Nov 06 2017 20:07
@korzo Thanks, but I'm still a beginner and it's to difficult for me to understand it at this stage...
CamperBot
@camperbot
Nov 06 2017 20:07
ingundela sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
api offline
Onome Sotu
@onomesotu
Nov 06 2017 20:09
@sjames1958gm yes i tried only $('.unit') and there is no result
Here it is on codepen
Stephen James
@sjames1958gm
Nov 06 2017 20:11
@onomesotu Are you replacing the units span from javascript?
Onome Sotu
@onomesotu
Nov 06 2017 20:11
yes i am
Stephen James
@sjames1958gm
Nov 06 2017 20:11
@onomesotu And when you do, do you keep the class unit?
Onome Sotu
@onomesotu
Nov 06 2017 20:11
jquery
Stephen James
@sjames1958gm
Nov 06 2017 20:12
@onomesotu If you use the inspector that span doesn't have the class unit anymore
Onome Sotu
@onomesotu
Nov 06 2017 20:13
oh yes
that is ture
Stephen James
@sjames1958gm
Nov 06 2017 20:13
@onomesotu var degree = '<h1><span class="temp">' + temperature + '</span><span>&deg;C</span></h1>', <<< there is no unit class
Onome Sotu
@onomesotu
Nov 06 2017 20:13
true*
but why does it take away the class unit on page load without the click of the button?
at least the page should load normally with the unit class and then disappear when the button is clicked(when the event is triggered).. shouldn't it?
Stephen James
@sjames1958gm
Nov 06 2017 20:15
@onomesotu When you build the degree element from js you destroy the span that had that class
Onome Sotu
@onomesotu
Nov 06 2017 20:16
@sjames1958gm oh boy.. what will i do without you loool
brain fart number 2 :)
thanks... solution in tow
Thanks @sjames1958gm
CamperBot
@camperbot
Nov 06 2017 20:16
onomesotu sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
:star2: 8673 | @sjames1958gm |http://www.freecodecamp.com/sjames1958gm
Stephen James
@sjames1958gm
Nov 06 2017 20:16
@onomesotu :nose:
Onome Sotu
@onomesotu
Nov 06 2017 20:17
:+1: @sjames1958gm
Stephen James
@sjames1958gm
Nov 06 2017 20:18
@onomesotu Be sure to use the inspector to verify assumptions such as elements having specific classes.
Onome Sotu
@onomesotu
Nov 06 2017 20:19
@sjames1958gm I will keep that in mind.. thanks.. it's so easy to lose track of stuffs like this when you add content dynamically
CamperBot
@camperbot
Nov 06 2017 20:19
onomesotu sends brownie points to @sjames1958gm :sparkles: :thumbsup: :sparkles:
api offline
Onome Sotu
@onomesotu
Nov 06 2017 20:23
@sjames1958gm Code is working like a charm now :smile:
thanks a lot
korzo
@korzo
Nov 06 2017 20:28
@ingundela it's not that complicated.
check this answer : https://stackoverflow.com/a/9880571/1412452
Ivan Ngundela
@ingundela
Nov 06 2017 20:30
@korzo Thanks.. I'll have a look
CamperBot
@camperbot
Nov 06 2017 20:30
ingundela sends brownie points to @korzo :sparkles: :thumbsup: :sparkles:
api offline
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 22:58
@alpox are you around?
Christopher Susi
@chrisandsuch
Nov 06 2017 23:00
@tiagocorreiaalmeida Not much chatter in here today.
@tiagocorreiaalmeida are you working on your project?
ArthurM111
@FocusAndItCanBeDone
Nov 06 2017 23:02
They used to have a pop up window chat room in freecodecamp do they still have it?
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 23:05
yeah having some issues but going to figure them out if not today tomorrow :D
ArthurM111
@FocusAndItCanBeDone
Nov 06 2017 23:23
@tiagocorreiaalmeida was that msg to me?
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 23:26
was talking to @chrisandsuch :D
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 23:39
@alpox nm figured it out once again, im getting good in figure out my own problems :D
Ross Gallego
@rossgallego
Nov 06 2017 23:41
thinking about quiting
Christopher Susi
@chrisandsuch
Nov 06 2017 23:48
@rossgallego what are you thinking about quiting?
@tiagocorreiaalmeida doing some reviewing courses at the moment. but I can try to help you tomorrow
Tiago Correia
@tiagocorreiaalmeida
Nov 06 2017 23:59
nah no need it was about an library but its solved ;) what are you checking at the moment?