Closing a fancybox

Scenario:

We are using a fancy box to present a form to the user to enter some data. Once this data is entered and the user submits the form, if the processing was successful, we want to show a message to the user and then close the fancybox (which is the form).

Code:

HTML

<a href="<%= ResolveUrl("~") %>RegForm" class="iFrameRegister" title="">Register</a>

Open the form:

$("a.iFrameRegister").fancybox({
        ‘frameWidth’: 400,
        ‘frameHeight’: 400
    });

Close the form:

parent.$.fn.fancybox.close();

Technorati Tags: ,,

  1. Klerisson

    Straight to the point! Good though!

    Anyway, what does “parent” in “parent.$.fn.fancybox.close();” stands for?

    Sorry about the newbie doubt.
    Thanks in advance!




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s



%d bloggers like this: