Stop video when I hide the div

My site starts with a div overlay and a youtube video. I made it so users can exit (hides the div), but the video keeps playing. How do I correct this?