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
catalin560
@catalin560
@sainiabhi yes I know that... after 1 second an alert will pop up
thats not what I'm looking for...
oh I think I got it!
Abhishek Saini
@sainiabhi
@catalin560 great :P
catalin560
@catalin560
can a button get a active property after being clicked?
@sainiabhi ?
Abhishek Saini
@sainiabhi
by active you mean what? @catalin560 are you trying to disable the button first?
catalin560
@catalin560
by active I mean its being clicked
Abhishek Saini
@sainiabhi
every button is supposed to be clicked :P
catalin560
@catalin560
@sainiabhi other question then... can it gain a "certain" property after being clicked?
Abhishek Saini
@sainiabhi
@catalin560 yes it can
@catalin560
$('button').attr('active', 'vfsdd');
catalin560
@catalin560
@sainiabhi nice! finally something I can use!
Abhishek Saini
@sainiabhi
@catalin560 keep going
:)
catalin560
@catalin560
@sainiabhi another problem
$('.start').click(function(){
        $(".btn-green").animate({bottom: "+=10px"});
    setTimeout(function(){
       $(".btn-green").animate({bottom: "0"});
    },200);
});
why wont it animate?
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/