code to close window

67 views
Skip to first unread message

richardwo

unread,
Nov 29, 2011, 12:47:48 PM11/29/11
to easybox-discuss
Hi - thanks for a great lightbox.
I want to use it to load a form via an iframe, after the form is
submitted it will display a thank you message and I would like to
include a big link to close the lightbox.
How would I close the lightbox from within the iframe content?
Message has been deleted

richardwo

unread,
Nov 29, 2011, 1:00:28 PM11/29/11
to easybox-discuss
P.S.
With ThickBox you can do onclick="self.parent.tb_remove();" within the
iFrame content - I'm hoping to find something similar to that.

Vincent

unread,
Nov 29, 2011, 1:06:29 PM11/29/11
to easybox...@googlegroups.com
Hi there.

This is not implemented yet. Please create an issue on my project page.

For now, you can do the following (hot tested)

1. get the unminified js
2. look for the autoClose function
3. before that, write
this.close = autoClose;
4. in your js, call
$.easybox.close

Hope this helps

Vincent

unread,
Nov 29, 2011, 1:10:37 PM11/29/11
to easybox...@googlegroups.com
Sorry, it's not
this.close = autoClose;
it's
$.easybox.close = autoClose;


Jhonatan Vicentini

unread,
Jun 26, 2012, 6:10:54 PM6/26/12
to easybox...@googlegroups.com
Where i found de unminified js?

Vincent Wochnik

unread,
Jun 27, 2012, 3:54:59 AM6/27/12
to easybox...@googlegroups.com
You can find it in the git repository. Have a look for easybox.js

2012/6/27 Jhonatan Vicentini <jhona...@gmail.com>:

Ravi Desaraju

unread,
May 26, 2013, 8:36:01 AM5/26/13
to easybox...@googlegroups.com
I did a workaround.. from the lightbox (URL) I am calling a parent javascript. Setting the DOM element directly.

In lightbox

if(typeof parent.window !== 'undefined' && typeof parent.window.closelightbox === 'function'){
        parent.closelightbox(); //Call the function only if it exists
    }

In parent

function closelightbox(){
    element=document.getElementById('easyCenter');
    element.style.display="none";
    element=document.getElementById('easyOverlay');
    //simulate a click...
    element.click();       
}

//this works in chrome, firefox, IE and Opera. I have not tested any other browser
Reply all
Reply to author
Forward
0 new messages