Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Aug 17 09:32
    User @bjorno43 unbanned @linkin-park
  • Jun 20 21:19
    @bjorno43 banned @shenerd140
  • Apr 25 17:13
    @mstellaluna banned @cmal
  • Jan 08 22:05
    @mstellaluna banned @dertiuss323
  • Nov 07 2018 04:42
    User @texas2010 unbanned @ows-ali
  • Nov 02 2018 16:25
    @texas2010 banned @ows-ali
  • Oct 12 2018 05:50
    @bjorno43 banned @NACH74
  • Oct 05 2018 23:02
    @mstellaluna banned @JomoPipi
  • Sep 16 2018 12:21
    @bjorno43 banned @yash-kedia
  • Sep 16 2018 12:16
    @bjorno43 banned @vnikifirov
  • Sep 05 2018 08:12
    User @bjorno43 unbanned @androuino
  • Sep 05 2018 07:38
    @bjorno43 banned @androuino
  • Aug 23 2018 16:57
    User @bjorno43 unbanned @rahuldkjain
  • Aug 23 2018 16:23
    @bjorno43 banned @rahuldkjain
  • Jul 29 2018 14:13
    User @bjorno43 unbanned @jkyereh
  • Jul 29 2018 01:00
    @bjorno43 banned @jkyereh
  • Jul 10 2018 22:09
    @bjorno43 banned @manafn
  • Jul 06 2018 15:20
    @texas2010 banned @imlegend19
  • Jul 03 2018 12:28
    @bjorno43 banned @vbvmatta
  • Jun 29 2018 13:54
    @bjorno43 banned @OGTechnoBoy
Kris Baillargeon
@krisb1220
@amare16 I answered your question in /FreeCodeCamp
iso
@iso1048
@sjames1958gm @ashwins93 thanks guys
CamperBot
@camperbot
gothamknight sends brownie points to @sjames1958gm and @ashwins93 :sparkles: :thumbsup: :sparkles:
:cookie: 417 | @ashwins93 |http://www.freecodecamp.org/ashwins93
:star2: 8756 | @sjames1958gm |http://www.freecodecamp.org/sjames1958gm
krj1
@krj1
I am making a program for a school project and need some help. the point of the program is to run the function t = ln( p / a ) / r which is a form of the A = pe^rt equation the only difference is I am suppose to round at every step. This is superposed to act like a person repetitively multiplying by r witch would be a decimal and this is the code I have so far
html
<html>
<head>
<script class="jsbin" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
  <script class="jsbin" src="http://ajax.aspnetcdn.com/ajax/jquery.templates/beta1/jquery.tmpl.min.js"></script>
<meta charset=utf-8 />
<title>MnM calculator</title>
<!--[if IE]>
  <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<style>
  article, aside, figure, footer, header, hgroup, 
  menu, nav, section { display: block; }
</style>
</head>
<body>
  <form>
    <h1>enter information</h1>
    <input id="title" type="text" placeholder="number of MnM" />
    <input id="name" type="text" placeholder="Number of MnM eaten" />

    <input type="button" value="save and run" onclick="insert()" />
  </form>
  <div id="display"></div>




</body>
</html>
and JavaScript


var titles  = [];
var names   = [];
var answer = titles[0];
answer = answer.toString();

var titleInput  = document.getElementById("title");
var nameInput   = document.getElementById("name");


var messageBox  = document.getElementById("display");

function insert ( ) {
 titles.push( titleInput.value );
 names.push( nameInput.value );


 clearAndShow();
}

function clearAndShow () {
  // Clear our fields
  titleInput.value = "";
  nameInput.value = "";


  // Show our output
  messageBox.innerHTML = "";

  messageBox.innerHTML += "Titles: " + titles.join(", ") + "<br/>";
  messageBox.innerHTML += "Names: " + names.join(", ") + "<br/>";
  messageBox.innerHTML += "Names: " + answer.join(", ") + "<br/>";


} 

/*
 var per = names.value() / 100;
 var total; 
 var i = 0;

 while (i < 4) {
  total = num * per;
  num = num - total;
 num = Math.round(num) ;

    i++;

}
 var answer = i.toString();
*/
Chi
@chiyc
@krj1 You haven't asked us a question. What do you want us to help you with?
Amit Patel
@AmitP88

hey guys, how do I use Modal.setAppElement(appElement); with react-modal? I'm getting an error in console that says:

browser.js?1af0:49 Warning: react-modal: App element is not defined. Please use Modal.setAppElement(el) or set appElement={el}. This is needed so screen readers don't see main content when modal is opened. It is not recommended, but you can opt-out by setting ariaHideApp={false}.

I've looked at the github docs here: https://github.com/reactjs/react-modal

but I couldn't find where they implemented it in the example code.

krj1
@krj1
i don't understand how to store and edit data with JavaScript when the data is provided by html. to that extent i don't know how to re show the data after i have ran my function
Amit Patel
@AmitP88
modal.png
Chi
@chiyc

@AmitP88 Here's some documentation that can help you. https://reactcommunity.org/react-modal/examples/set_app_element.html

You need to call Modal.setAppElement() outside of the class declaration. The argument you pass it can be HTML query selector

Chi
@chiyc
@krj1 You start off by selecting the DOM node you want to get data from or push data to. You can use this using the standard browser API or jQuery. Then, there are additional methods to either retrieve or replace the HTML inside your selected nodes
AbrisM
@AbrisM
@krj1 Your lucky you can link to google fonts. We aren't allowed to use any external links :(
google library*
Does anyone know how to successfully add a moving background in their html file? I have a .mov and I'm wondering how to incorporate it as a background image in html
AbrisM
@AbrisM
got disconnected, thanks :D
Does anyone know how to make the blink effect in CSS compatible for chrome?
Amit Patel
@AmitP88
@chiyc actually, I was able to resolve it by passing in ariaHideApp={false} in <Modal>, but thanks for your help. I really appreciate it :)
CamperBot
@camperbot
amitp88 sends brownie points to @chiyc :sparkles: :thumbsup: :sparkles:
:cookie: 342 | @chiyc |http://www.freecodecamp.org/chiyc
Chi
@chiyc
@AmitP88 Awesome! Glad you figured it out
Amit Patel
@AmitP88
@chiyc actually I found the solution on here: reactjs/react-modal#576 but thanks lol :)
CamperBot
@camperbot
amitp88 sends brownie points to @chiyc :sparkles: :thumbsup: :sparkles:
api offline
Amit Patel
@AmitP88

@chiyc I am running into another issue though, this time with a react slider:

(https://github.com/akiran/react-slick) I'm having some trouble figuring out how to get slide content to show up properly. It shows up where the dots are at the bottom instead of on the actual slides (slides appear blank). I get no errors in console either.
questionaire-component.png

the code I used is from the example code in the docs (will modify later)
Liang-Shih Lin
@ll931217
@AbrisM Use animation and opacity
Chi
@chiyc
@AmitP88 Do you possibly still need slick-carousel css and fonts?
Amit Patel
@AmitP88
@chiyc I do, but I was hoping I can save that for later. For now I'm more focused on just getting my components (and content) to render properly in the right places
Chi
@chiyc
@AmitP88 It's possible that you need them for it to display properly. You can either @import the packages you need or add the CDN link to your HTML, which would be a quick change
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick.min.css" />
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/slick-carousel/1.6.0/slick-theme.min.css" />
Amit Patel
@AmitP88
@chiyc hmm, I'll give it a shot real quick using the CDN. if it works, I'll import the packages
@chiyc it sorta worked, except now my previous button disappeared lol. I'll see if I can figure that part out though
slideshow-adjusted.png
Chi
@chiyc
Hahah, did you get both CDN links in there?
Amit Patel
@AmitP88
yeah lol
hmmm, my close button won't work either when I click it
Chi
@chiyc
Interesting. Also, are you using React DevTools to help debug your app?
Amit Patel
@AmitP88
yeah, I'm using that too, but no errors showed up on that either
reactdevtools.png
Chi
@chiyc
Even if there are no actual errors, it can help you locate where the different components of your app are
Your <Slider /> component should have a nested <InnerSlider /> component and a div with your <PrevArrow /> and <NextArrow /> inside that div
Amit Patel
@AmitP88
slideshow-adjusted.png
Chi
@chiyc
Exactly, and when you hover over the different lines of React code, it highlights the corresponding element on the page
Amit Patel
@AmitP88
yeah, the <InnerSlider> is in there. I don't know why the modal close button isn't working though. I'm not sure if I should move it to the slideshow component, since the slideshow is nested within it
logically the modal component funcationality and slideshow funcationality should be separate right?
Chi
@chiyc
I don't know if you've changed the Modal code from earlier, but you had set isOpen={true}, meaning it will never close