Close FB before following link? ...

Page: 1

Author Post
Member
Registered: Apr 2009
Posts: 28
We could set a "target=_blank" on the text link content
in Floatbox, but I'd prefer to keep the user on the same page.

Is there a graceful way to close FB before following a
clicked link?

Thanks!
« Last edit by jmueller0823 on Thu May 21, 2009 10:50 pm. »
Administrator
Registered: Aug 2008
Posts: 3382
<a href="pageToShow.html" onclick="parent.fb.loadPageOnClose=this.href; parent.fb.end(); return false;">Close and navigate</a>
Member
Registered: Apr 2009
Posts: 28
Perfect. Thank you.
Member
Registered: May 2009
Posts: 2
I am trying to do the same thing. I have a form that opens using floatbox. The form is setup to take the user to a different url upon valid submission. I'd like that URL to open up in the main window. Is it possible for floatbox to do this even though new url is called from the form script?
Administrator
Registered: Aug 2008
Posts: 3382
This is a little more challenging, but not too bad. What you need to do is to have the page that is returned in response to the form submission include the javascript code required to close floatbox and navigate to another page.

Let's say you have submitted your form from floatbox. The returned page could look something like:
<html>
<body onload="parent.fb.loadPageOnClose = 'somePage.html'; parent.fb.end();">
</body>
</html>


Replace 'somePage.html' with the path to the content you want to load in the main page after the form submittal.
Member
Registered: May 2009
Posts: 2
Thanks! I'll see if I can make that work. The page is a php file with no html or body tags.

Page: 1