Automatically close webform after submission
You need to use hook_form_alter() and on submit of the form you need to set action like this

$form["#submit"][] = "ajax_modal_form_submit";


and add function

function ajax_modal_form_submit($form,&amp;$form_state) {
    ctools_include('ajax');
    ctools_include('modal');    
    $form_state['ajax_commands'][] = ctools_modal_command_dismiss();
    $form_state['ajax_commands'][] = ctools_ajax_command_reload();
    drupal_set_message(t("You detail submitted successfully!"));
  }