On click event option added -- will not conflict with before or after cl...

1. Added functionality for on click.

2. On click event will not be triggered on clicking the close button.