I need help for open and close action menu using css : I am creating a floating action buttons and here is my code

My Code: 
jsfiddle.net/7zkjas08


Currently in my code when user click the action button the popup appears and user need to click or tap in somewhere in the screen to close the popup.

I want functionality like this : jsfiddle.net/r2hxbL5j

 
When user click the button it shows the cross X closing sign. So user can tap/click the cross sign and popup disappears. Please help me how can i do this.