How to resize on click and change back if clicked again?

I’m trying it with this one, but sometimes the .click() just automaticly does the command not waiting for actual click.

var x = 0; 

if ($('#business').click() && (x = 0)) {
  $('#business').css('height', '500px');
  x = 1;
} else if ($('#business').click() && (x = 1)) {
  $('#business').css('height', '100px');
  x = 0;
}

I can resize it with the below code, but unfortunately dont know how to change back on click again.

$('#business').click(function(){
  $('#business').css('height', '500px')
})