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
Abhishek Saini
@sainiabhi
@catalin560 let me check will let you know
Abhishek Saini
@sainiabhi
@catalin560 it's because you should give .btn-green{position: absolute;}
similarly set position:absolute for other buttons too
catalin560
@catalin560
@sainiabhi I found a way to animate colors for each button wanna give it another try and tell me what you think? :)
@catalin560 press start then press each button that flashes white
Abhishek Saini
@sainiabhi
@catalin560 sure
catalin560
@catalin560
@sainiabhi hey you still there?
Abhishek Saini
@sainiabhi
@catalin560 yeah tell me?
catalin560
@catalin560
@sainiabhi I have a question
I've made this basic, very rudimentary Simon Says app
now what I want to do is make it so that it happens at random
can I declare those click()functions as variables and make them run thru a rand() function or something like that?
like
var colors=[green,red,yellow,blue]
var green=function(...)
etc
call rand(colors)???
Abhishek Saini
@sainiabhi
you want to randomly pick colors?
catalin560
@catalin560
@sainiabhi yes
Abhishek Saini
@sainiabhi
var colors = [green,red,yellow,blue];  //array
var num = Math.ceil(Math.random() * 3);  // as we have 4 items in the array, we will throw random numbers to select a number randomly 

var randomColor = colors[num];  //It will take colors randomaly from array colors
@catalin560
catalin560
@catalin560
@sainiabhi thanks :)
CamperBot
@camperbot
catalin560 sends brownie points to @sainiabhi :sparkles: :thumbsup: :sparkles:
:cookie: 310 | @sainiabhi |http://www.freecodecamp.com/sainiabhi
Abhishek Saini
@sainiabhi
@catalin560 welcome
Brandon
@bd1887
Hi everyone. I'm having a problem where one of my CSS elements is losing its font-size style when I use JS to feed it content. I've written comments above the problem sections:
http://codepen.io/bd1887/pen/kkQVjy?editors=0110
catalin560
@catalin560
@sainiabhi Isn't this the correct way of declaring a function?
$('.start').click(green);

var green=$('.btn-green').click(function(){
  $('#text').html('test green!');
  $(".btn-red").css('cssText', 'background: white; transition: background 1s ease;');
  setTimeout(function(){
      $(".btn-red").css('cssText', 'background: red; transition: background 1s ease;');
  }, 600);  
});
Abhishek Saini
@sainiabhi
@catalin560 i think this should be the correct way, I'm not sure please run the code and confirm
var green = function() {
$('.btn-green').click(function(){
  $('#text').html('test green!');
  $(".btn-red").css('cssText', 'background: white; transition: background 1s ease;');
  setTimeout(function(){
      $(".btn-red").css('cssText', 'background: red; transition: background 1s ease;');
  }, 600);  
});

}
catalin560
@catalin560
@sainiabhi tried it that way also :) it doesn't work :(
Abhishek Saini
@sainiabhi
what you are trying to do? @catalin560
catalin560
@catalin560
@sainiabhi
$('.start').click(green);
I'm trying to test it
Abhishek Saini
@sainiabhi
$( ".start" ).click(function() {
  green();
});
try this
I think syntax is incorrect
Ramesh
@rnallu
Guys, i'm newbie. Can you please tell me how to get the data from this api. Link: http://api.forismatic.com/api/1.0/
sorry, refer this link http://forismatic.com/en/api/
Abhishek Saini
@sainiabhi
@rnallu bro if you are working with jquery then
$.ajax({
    headers:{
      'X-Mashape-Key':'LJgziTt4comshsPvkQ53wDltTjJRp1BtUA1jsnFeZf6GUpcBq9',
      Accept: 'application/json',
      'Content-Type' : 'application/x-www-form-urlencoded'  
    }, 
    url: 'put api url',
    success: function(data){
      data //It's the api data
    }
  });
$.ajax({
    url: 'https://andruxnet-random-famous-quotes.p.mashape.com/?cat=movies',
    success: function(data){
      data //your api result
    }
  });
Ramesh
@rnallu
@sainiabhi Thanks bro, but pls help with reference to the above link. so that i can understand how to call JSON with jquery.
CamperBot
@camperbot
rnallu sends brownie points to @sainiabhi :sparkles: :thumbsup: :sparkles:
:cookie: 311 | @sainiabhi |http://www.freecodecamp.com/sainiabhi
Abhishek Saini
@sainiabhi
$.ajax({
    url: 'http://api.forismatic.com/api/1.0/?method=getQuote&format=json&lang=en',
    success: function(data){
      console.log(data);
    }
  });
@rnallu Run this code and open your console to see the result
Ramesh
@rnallu
@sainiabhi not worked
David Pickup
@davidpickup
Completing the challenge "No repeats please”, and it says that all but the first test have failed. When I manually test each of the tests individually, I get the correct output. I therefore don’t know why the automated tests fail!
kirbyedy
@kirbyedy
ok and ?
David Pickup
@davidpickup
So is this a bug on the page? The “what to do if you find a bug” instructions say to ask for help here before reporting an issue.
kirbyedy
@kirbyedy
are you sure your code is correct ?
David Pickup
@davidpickup
When I manually call my function with each of the test calls, the correct result is returned.
kirbyedy
@kirbyedy
what you can do is copy that code somewhere, and try to reset the code and clear the cache of your browser
then paste in the code again and try
assuming your code is correct, the issue should be solved
David Pickup
@davidpickup
OK, done that and the issue is still there. Would it be possible to post the code here and you/someone to test it on that challenge page?
kirbyedy
@kirbyedy
sure
actually you might post it in the javascript room