How do I get my jump animation to work?

I finally got jumping in my game, but now I want him to switch to his jump animation when he is not grounded. I tried putting it with the void jump and within the void OnCollisionEnter, as well as under the jump button in Update, but it does not play.

using UnityEngine;
using System.Collections;
using SpriteFactory;
 
public class player : MonoBehaviour {
 
 
 
    public float speed = 1.0f;
    public float jumpSpeed = 10.0f;
    public float gravity = 20.0f;
	public bool grounded = true;
 
 
    private Transform thisTransform;
    private Sprite sprite;
    private bool flipped;
 
    // Use this for initialization
    void Awake () {
       thisTransform = transform;
       sprite = (Sprite)GetComponent(typeof(Sprite));
 
    }
 
    // Update is called once per frame
    void Update () {
       Vector3 moveVector = new Vector3(0,0,0);
       bool moving = false;
		
		moveVector.y -= gravity * Time.deltaTime;
		
		if(Input.GetKeyDown(KeyCode.Space)){
			 Jump();
			
			
			
		}
	
		
 
 
 
    if(Input.GetKey(KeyCode.A)){
         moveVector.x -= 1.0f;
         moving = true;
 
    }
 
       if(Input.GetKey(KeyCode.D)){
         moveVector.x += 1.0f;
         moving = true;
 
 
       }
 
 
       if(Input.GetKey(KeyCode.Mouse0)){
         Attack();
       } else {
         if(!IsAttacking()) {
          if(moving) {
              Move(moveVector);
          } else {
              Stand();
         }
       }
       
       if(Input.GetKey(KeyCode.S)){
         Crouch();
       } else {
         if(!IsCrouching()) {
					
			}
				 if(moving) {
              Move(moveVector);
          } 
				else {
         Stand();
    }
    }
       }
    }

 
 
 
 
 
    private void Stand() {
       sprite.Stop();
    }
 
 
    private void Move(Vector3 moveVector) {
       FlipSprite(moveVector.x);
       moveVector *= speed * Time.deltaTime;
       thisTransform.position = thisTransform.position + moveVector;
       sprite.Play("walk");
 
 
 
 
    }
 
    private void FlipSprite(float x) {
       if(x == 0.0f) return;
 
       float xDir = Mathf.Sign(x);
       if(!flipped && xDir < 0.0f) {
         flipped = true;
         sprite.SetFlippedState(true, false);
       } else if(flipped&& xDir > 0.0f) {
         flipped = false;
             sprite.SetFlippedState(false, false);
       }
    }
 
    private void Attack() {
       if(IsAttacking()) return;
 
       sprite.Play("Sword");
    }
 
    private bool IsAttacking() {
       if(sprite.IsAnimationPlaying("Sword")){ return false;}
       return false;
 
 
}
 
    private void Crouch() {
       if(IsCrouching()) return;
 
       sprite.Play("crouch");
    }
 
    private bool IsCrouching() {
       if(sprite.IsAnimationPlaying("crouch")) {return false;}
       return false;
 
 
 
 
 
 
 
 
}  
	void Jump(){
		if(grounded == true)
		{
		rigidbody.AddForce(Vector3.up * jumpSpeed);
			grounded = false;
	}
	}
	
	void OnCollisionEnter(Collision col){
		if(col.gameObject.tag == "floor"){
			grounded = true;
			sprite.Play("jump");
		}
			
		
		}
 
 
 
 
 
}

Add a raycast that goes from the center of the guy towards the ground at a distance of half the guy’s height. Then if the raycast is false it means you are in the air, play jump animation.

Transform tr;
float height;
int layerMask;

void Start(){
   tr = transform;
   height = collider.bounds.extent.y;
   layerMask = LayerMask.NameToLayer("Player");
}
void Update(){
   if(!Physics.Raycast(tr.position, Vector3.down, height,layerMask)){
      anim.CrossFade("Jump");
   }
}

Best would also be to check if you are jumping or falling since you may not play the same animation for each.
The layer allows the cast to go through the player or ignore the player.