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
Andrew Charlebois
@andrewchar
<a href="https://twitter.com/share" id=" twiterbtn" class="twitter-share-button" data-text="hey" data-via="Andrew_Char">Tweet</a>
Salman Shahid
@salman-shahid
Ok, one sec. I'll try to write this in one line then I will explain what it does.
Brb, two minutes.
$("#twitter-btn").data-text = getRandom(); }
paste that after generateBtn.onclick = function() { in your js section
Salman Shahid
@salman-shahid
I just updated it, so if you copied it before redo it.
I think that should work.
So when your button is clicked it changes the data-text type of your twitter button.
the data-text type is the text that is displayed in the field when you click on the tweet button
Andrew Charlebois
@andrewchar
Invalid left-hand side in assignment
Salman Shahid
@salman-shahid
Oh, $("#twiterbtn").data-text = getRandom(); }
Sacharias Sjöqvist
@sacharias
@finklez Thank you!
CamperBot
@camperbot
sacharias sends brownie points to @finklez :sparkles: :thumbsup: :sparkles:
:star: 472 | @finklez | http://www.freecodecamp.com/finklez
Salman Shahid
@salman-shahid
It's because I spelt the id differently than what you had. If you copy paste that it should work.
How's that @andrewchar ?
Andrew Charlebois
@andrewchar
still saying invalid left hand side
Salman Shahid
@salman-shahid
Omg, it's too early, sorry I forgot!
See if removing the curly braces makes a difference (the one at the end of the line that I gave you
gr4vy
@gr4vy
I am trying to figure out why my onkeydown event handler function doesn't seem to work right... I am trying to get the little green square to move using the green arrows (works) and stop at the walls (doesn't work)... if you get to the wall you can keep pressing in the same direction as wall (the green square won't move, but the value of its position moves in logic creating console errors... http://codepen.io/gr4vy/pen/ZQqmBx
Andrew Charlebois
@andrewchar
@mynameissal what language code is that
Salman Shahid
@salman-shahid
JS but I don't know what's wrong with my code. I think there is also something wrong with your JS twitter code. I get an error when I try to run your codepen..
Salman Shahid
@salman-shahid
@andrewchar Yeah I'm getting no where with this..It's 4am here so I'm heading to bed. I'll see what I can do to help tomorrow.. I am all over the place right now..
Andrew Charlebois
@andrewchar
@mynameissal its okay. thanks anyway
CamperBot
@camperbot
andrewchar sends brownie points to @mynameissal :sparkles: :thumbsup: :sparkles:
:star: 285 | @mynameissal | http://www.freecodecamp.com/mynameissal
Kevin Elser
@CoffeeCodeKevin
Anyone know of any way to keep animations from all happening at once in a for loop?
I have it set up so it'll animate one of 4 divs depending on a value I got from i in for loop like this: for(i=0;i<arr.length;i++)
Problem is it just animates all 4 at once.
Or whichever ones the value corresponds with for the entire loop
Eran Finkle
@finklez
@keccakec don't do animation this way, CSS has 2 ways of animating, using transition and animation
you set a class with animation, you can set duration and delay, and even loops, then you can add/remove the class
Kevin Elser
@CoffeeCodeKevin
@finklez Thanks, jQuery animation is just easier syntax-wise for what I want to do, but that does seem like it would work a lot better.
CamperBot
@camperbot
keccakec sends brownie points to @finklez :sparkles: :thumbsup: :sparkles:
:star: 473 | @finklez | http://www.freecodecamp.com/finklez
Eran Finkle
@finklez
@keccakec you can also do it with jQuery, but for loop is a bad way for applying animations, if i'm not mistaken animation are applied async which means you'll have to use closures for it to work, but anyways it's a bad way, you can still use jQuery using delays for each div
Kevin Elser
@CoffeeCodeKevin
@finklez Yeah, I'm now using it to make sure the animations have about a 100ms delay between them. Unfortunately changing my animation functions to be css animations somehow broke my code? Either that, or codepen doesn't like me. Everything in my JS is now undefined.
I'm beyond confused considering I only changed the animation functions.
Even global variables are undefined
I forgot a semicolon.. fml.
Eran Finkle
@finklez
:D
i guess it's ok then
css animation are much better, smoother, faster, even tho recent jQuery animation are prob using css animations as well, instead of the old position style
Mark Lawrence
@ninja-ml
i'm working on my weather app and and the icons provided by OpenWeather seem really small... i've found better icons online that use font awesome but it says I have to put them in a Font folder... how would I do that in CodePen?
Jonathan Coleman
@jondcoleman
@ninja-ml you won't be able to put them into a folder on codepen. You'll have to store the images on an online service. Some people use imgur. I put them in my public dropbox folder and use the urls for them from there
Mark Lawrence
@ninja-ml
@jondcoleman thanks, that's what I thought, but I wasn't sure... I've used my public dropbox folder for images for other projects. I"m looking into using the Dark Sky API instead of OpenWeather API
CamperBot
@camperbot
ninja-ml sends brownie points to @jondcoleman :sparkles: :thumbsup: :sparkles:
:star: 513 | @jondcoleman | http://www.freecodecamp.com/jondcoleman
Jonathan Coleman
@jondcoleman
cool, let us know how you like Dark Sky
Amir Ghafouri
@amirghafouri
@mutantspore (or anyone else) Am I on the right path?
function decTime() {
  //fill the circle
  filler(countDown);
  // display the current count down
  showCount();
  // decrement the counter if it's not at zero
  if (countDown > 0) {
    countDown--;
  } else {
    countDown = breakSeconds;
    if (countDown > 0) {
      countDown--;
    } else {
      // stop the timer
      clearInterval(intervalID);     
    }
  }