How Close ?

Page: 1

Author Post
Member
Registered: Apr 2009
Posts: 28
We've been using Floatbox successfully for years, so no issues.

We want to include a clickable image that will close FB.

parent.fb.end() does not work as it seems it's looking for a
'parent' page (?) and causes a 404 error.

So, which function should I use?
I did check the docs...

Thanks.
Jim
Administrator
Registered: Aug 2008
Posts: 3382
fb.end() is the right function to call to close a floatbox from script.

If the script is executing from an iframe that does not include floatbox.js, and so does not have the fb object defined in it, the function can be referenced from the parent page's fb object with parent.fb.end().

Referencing parent from a page that does not have a parent does not throw an error. On the top document in an iframe hierarchy, the global parent variable references the top window itself. On the top page, window === top === self === parent.

If you are getting a 404, then somewhere in your script you are requesting a new page that does not exist. The fb.end() function can request a new page when the floatbox finishes animating out if a URL for a page is passed as a parameter to fb.end(), as in fb.end('somePage.html'). Floatbox can also be set to request a new page by assigning a value to the 'loadPageOnClose' option.

If you can show me the problem online somewhere, I will be able to determine exactly what is generating the 404 error without guessing.
Member
Registered: Apr 2009
Posts: 28
Thank you.

Simply, I'm displaying an HTML page... not sure where the 404 is coming from.

I'm calling FB like this:

fb.start('http://www.domain.com/subscribe.php','width:790 height:250 scrolling:no')

...and I'm looking for a function that acts just like the "x"
Administrator
Registered: Aug 2008
Posts: 3382
fb.end() is the API function that closes the floatbox. The close button ('x') calls this function when clicked or touched.

Page: 1