These are chat archives for FreeCodeCamp/HelpFrontEnd

24th
Sep 2018
newmoon
@newmoon
Sep 24 2018 00:20
image.png
@bradley1492 Your navbar isn't working because you added the bootstrap CSS instead of bootstrap JS to the settings in codepen
The padding is added to the container via padding-top in CSS. You can do this with classes in bootstrap. p-0, p-1, p-2....p-5 all give padding equal to 0em, 1em, 2em....5em https://getbootstrap.com/docs/4.1/utilities/spacing/
Lia-Sue-Kim
@Lia-Sue-Kim
Sep 24 2018 01:11
can somebody help with html table please?
Dhaval Vira
@dhavalveera
Sep 24 2018 01:12
what help you need with HTML Table ? @Lia-Sue-Kim
on the right side
where the word 'they'
stands in td
i want it to be the same size as the others on the left side
i mean not the same size but just how to shrink it down
Alvis
@Flush7
Sep 24 2018 01:17
i didnt get it @Lia-Sue-Kim
newmoon
@newmoon
Sep 24 2018 01:39
@Lia-Sue-Kim Add this to your td CSS:
td {
  max-width: 100%;
  white-space: nowrap;
}
Lia-Sue-Kim
@Lia-Sue-Kim
Sep 24 2018 04:27
@newmoon it didn't work
i gave class fix-me
in this example with your properties and values
Claudio Restifo
@Marmiz
Sep 24 2018 04:49
@Lia-Sue-Kim what are you trying to fix?
Christopher
@bradley1492
Sep 24 2018 10:18
@newmoon oh thanks for the navbar CSS/JS CDN Bootstrap Tip yesterday :)
And the padding :)
rh616
@rh616
Sep 24 2018 13:55
window.jQuery = ???
window.$ = jQuery
var $div = $('div')
$div.addClass('red')
$div.setText('hi')
i dont know how to blank ???
may i ask you about this?
Aditya
@ezioda004
Sep 24 2018 14:02
@rh616 What do you mean by "how to blank"?
rh616
@rh616
Sep 24 2018 14:03
to make the codes below can be called
i dont know how to describe it clearly in english
i mean just like let the whole codes can be running
Aditya
@ezioda004
Sep 24 2018 14:22
@rh616 I'm sorry, I dont know what you're asking
What does window.jQuery = ??? mean?
Corey Lewis
@cursiv3
Sep 24 2018 14:42
@rh616 if you're asking how to make jQuery execute the code you'll want to w
wrap it in a $(document).ready(funtion { do stuff with jQuery here})
Ellyria
@Ellyria
Sep 24 2018 15:51
Hey there, @AJ-Brommy, thank you for the link! That helped a lot on top of the other links I had gotten on the topic. This seems to be one of those CSS "gotcha's" that we need to be aware of. Your suggestion for applying padding to the top of the form is one way of accomplishing it. It can also be done by adding overflow: auto or overflow: hidden to the form as long as that wouldn't cause unexpected consequences elsewhere. Yet another way would be to apply a negative margin to the top of the form. Those are all Band-Aids, though, and the purpose of my quest was to understand the why of it. I'm actually glad it happened, because it was quite a head-scratcher and I'd rather have that now than when I'm on a job.
Congratulations on the Responsive Web Design certificate, @AJ-Brommy! I'm right on your heels. I've got three projects to go before I get mine, too.
rk
@rajkumart08_twitter
Sep 24 2018 16:27

hi,

  • I am trying to change the css of the maps.
  • I inspected the elements the maps are in svg.
  • not sure how to target svg
  • can you guys tell me how to change the color of the maps.
  • providing my code below

https://stackblitz.com/edit/angular-yjureh?file=src%2Fapp%2Fapp.component.html


<svg width="900" height="600">
  <g>
    <path d="M543.7687268726875,279.359603187116L544.0570557055706,280.20992490177554L543.7687268726875,281.53449184206283L544.2492749274928,282.81396424130793L543.8648364836486,283.858168243876L544.0570557055706,284.7612304548729L538.4826982698271,284.7612304548729L538.386588658866,293.5251827611785L540.2126712671269,295.7975901018567L541.9426442644266,297.54479735919404L537.0410541054107,298.7129383258159L530.6017101710172,298.2745665511551L528.6795179517953,296.96173694793265L517.9152415241525,297.0588675278895L517.434693469347,297.25318394592426L515.8969396939696,295.9914340664074L514.1669666966698,295.9429663617114L512.5331033103312,296.37933759033234L511.28367836783696,296.9131785465529L510.99534953495356,295.16808867665605L511.379787978798,292.70557107271907L512.340884088409,290.2058267042117L512.4369936993701,289.0077916130968L513.3019801980199,286.52327898532815L513.9747474747476,285.4274062224762L515.5125012501252,283.6207144267058L516.377487748775,282.3872263196769L516.6658165816583,280.3990096380495L516.4735973597361,278.8404047319122L515.7047204720474,277.8501139823666L514.9358435843585,276.2021715359966L514.359185918592,274.6041942494021L514.455295529553,274.04084615171587L515.3202820282029,272.96199264007896L514.455295529553,270.3398463597317L513.9747474747476,268.5639576135259L512.6292129212923,266.83719456734644L512.8214321432145,266.32425430486114L513.9747474747476,265.99793334187507L514.7436243624364,266.0445461459323L515.7047204720474,265.7182874538488L523.489598959896,265.7182874538488L524.1623662366238,267.72363004445907L524.9312431243126,269.35811225287165L525.6040104010402,270.24631259750623L526.5651065106512,271.6501293442966L528.391189118912,271.41603716681533L529.2561756175619,271.04159310099783L530.6978197819783,271.41603716681533L531.0822582258227,270.7608423935989L531.7550255025504,269.1712064097301L533.4849984998501,269.07776418429364L533.5811081108112,268.6106586021739L534.9266426642665,268.6106586021739L534.7344234423443,269.54504685530713L537.9060406040605,269.54504685530713L538.0021502150216,271.2287993306726L538.5788078807882,272.2590062332029L538.1943694369438,273.90005994905914L538.386588658866,275.5438474837609L539.2515751575158,276.5785719029566L539.0593559355937,279.78465040202457L539.7321232123213,279.54848521855683L540.8854385438544,279.59571267132276L542.6154115411542,279.21797070157066ZM512.4369936993701,265.4852892445871L511.76422642264237,263.482925816795L512.8214321432145,262.3198415573684L513.6864186418643,261.90130867540546L514.6475147514753,262.7849862175638L513.6864186418643,263.34331595414176L513.2058705870588,264.0414784978145L513.1097609760977,265.20573861311107Z" class="__web-inspector-hide-shortcut__"></path>
newmoon
@newmoon
Sep 24 2018 17:03
image.png
@Lia-Sue-Kim It works great for me, no need for a fix-me class. https://codepen.io/anon/pen/GXaxjp?editors=0100
newmoon
@newmoon
Sep 24 2018 17:08
@rh616 We don't need to expose jQuery to the global object. We can do:
<div></div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script>
  var $div = $("div");
  $div.addClass("red");
  $div.text("hi");
</script>
If you're also curious how to expose jQuery to the global object though, the code would be:
window.jQuery = window.$ = jQuery;
And, as @cursiv3 mentions, it's a good idea to make sure the page is ready before running any code. $(document).ready() is obsolete, instead it's recommended to do:
$(function() {
  // your code goes here
  var $div = $("div");
  $div.addClass("red");
  $div.text("hi");
});
Supra01
@Supra01
Sep 24 2018 17:36
I'm pretty sure I have the correct answer to this smallest common multiple algorithm but it won't past the last test on freecodecamp. Has anyone gone through this or know what I should?
function smallestCommons(arr) {
    //Sort argument from least to greatest
    const sorted = arr.sort((a,b)=>a-b);
    //Create the range of numbers from argument
    let range = []
    let result="";
    for (let i = sorted[0]; i <= sorted[1]; i++) {
        range.push(i);
    }
    //Make a function that checks for divisible numbers
    function noRemainder(num){
        for (let i = range.length-2; i >= 0 ; i--) {
            if(num % range[i] !== 0){
                return false;
            }
        }
        return num;
    }
    // Multiply big number
    for (let i = 0; result.length < 1; i++) {
       if(noRemainder(range[range.length-1]*i)) {
         result = noRemainder(range[range.length-1]*i)
       }
    }
    return result
  }

console.log(smallestCommons([23,18]));
Eric Weiss
@eweiss17
Sep 24 2018 17:52
@Supra01 what is the last test?
Supra01
@Supra01
Sep 24 2018 18:02
@eweiss17 console.log(smallestCommons([23,18])) should return 6056820
Eric Weiss
@eweiss17
Sep 24 2018 18:04
i ran it and i got that answer
Supra01
@Supra01
Sep 24 2018 18:06
Thank you I don't know what to do. It won't take my code
Brad
@bradtaniguchi
Sep 24 2018 18:07
@Supra01 you sure your not getting a compile error or anything? (check your browser console)
Yea I ran the code locally and it worked. The only thing I can think of is something todo with the internal function definition (noRemainder) or something dumb
newmoon
@newmoon
Sep 24 2018 18:09
@Supra01 One issue might have to do with: for (let i = 0; result.length < 1; i++) {. The result variable is a number and numbers don't have length. Try doing smallestCommons([23, 13]) and you'll get an infinite loop.
Odd that it doesn't pass the test though - definitely returns the right answer, so maybe more to that test.
Brad
@bradtaniguchi
Sep 24 2018 18:12
@newmoon nice catch, didn't even see that
newmoon
@newmoon
Sep 24 2018 18:13
I need to revisit elementary math to help more haha - don't have any idea how to get the least common multiple for a range of numbers
Supra01
@Supra01
Sep 24 2018 18:16
@bradtaniguchi @newmoon Thank you look into it now this one has been driving me nuts
Sorry I meant I will look into it
It's 3am where I'm at
rk
@rajkumart08_twitter
Sep 24 2018 20:09

hi,

  • I used the below example and I am able to display the maps, airport an planes.
  • but I am not animate the planes.
  • can you tell me how to fix it.
  • so that in future I will fix it myself.
  • providing code and stackblitz below.
  • I dont see any errors in the console too.

https://stackblitz.com/edit/angular-2gjcbr?file=src/app/app.component.ts

  public transition(plane, route) {
    var l = route.node().getTotalLength();
    plane.transition()
      .duration(5000)
      .attrTween("transform", this.delta(route.node()));
  }

  public delta(path) {
    var l = path.getTotalLength();
    return function (i) {
      return function (t) {
        var p = path.getPointAtLength(t * l);
        return "translate(" + p.x + "," + p.y + ")";
      }
    }
  }