Tuesday, April 3, 2012

Close a fancybox after submitting a form

Many of them are using fancybox for form display.But they facing a problem how to close it after submitting the form.Here is the code

    /* Close the fancybox when you submit a form
     */
    $('#myform').submit(function(){
    $.fancybox.close();
    return false;
    });
     
    /* Here's another approach,
     * but this time we're tied to the submit button
     */
     
    $('#submit_button').click(function(){
    $.fancybox.close();
    return false;
    });

0 comments: