How close a iframe in thickbox from within

Probably this info is well known diffused on the web, but since i´m loving to use ThickBox.. 😀

You are using Thickbox to open a iFrame in your site, but don´t have control of it from inside the frame?! Let´s close it as if it were a Ajax box, but calling it from the parent (you may also use parent.eval()to run any other function known to the parent)

<a onclick=" parent.eval('tb_remove()')" > [X] </a>

You may use this code inside a link along other JS, or in a Form ‘onsubmit=’, or a Button ‘onclick=’
Done!

Advertisements

12 thoughts on “How close a iframe in thickbox from within

  1. Thank you for posting this and making it easy to find since it is something that these scripts lack documentation on.

  2. Remarkable issues here. I am very happy to peer your post.
    Thanks so much and I am taking a look ahead to touch you.

    Will you please drop me a mail?

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