Jump to index from external page

Page: 1

Author Post
Member
Registered: Apr 2013
Posts: 7
I have a home page with 35 floatbox links in a group. I can traverse using arrow keys. Page 4 of 35 contains a link to the content of page 7.

I'm trying to find the way to setup a link within the content of page 4 that will jump the floatbox to page 7. I expected onClick="parent.fb.showIndex(7);" would work, but I seem to be missing something.

Any tips/clues/rtfm's?

TIA!
Administrator
Registered: Aug 2008
Posts: 3382
parent.fb.showItem(6); return false; should do the trick. It does for me. Note that it is showItem, not showIndex, the indexes are zero-based, and you need to return false to prevent the clickable link from navigating. If that doesn't work, maybe you've got an elderly version of Floatbox that needs to be updated.
Member
Registered: Apr 2013
Posts: 7
I'm using 4.2.7. Updated to 5.7.2, but then scrollbars disappear after closing a floatbox and the main page is not scrollable anymore. I already tried your solution, but it fails every time. Is 4.2.7 too old?
Administrator
Registered: Aug 2008
Posts: 3382
I don't know if 4.2.7 is too old or not, but I can provide support only for problems with the current version.

I don't understand your report of disappearing scrollbars. I've never seen that or heard anyone report it. I'd love to see it in action to determine what's going on.

As for fb.showItem not working for you, I'd have to see that live in context too to figure out what's going on. Can you link me in to a test page where you're experiencing this trouble?
Member
Registered: Apr 2013
Posts: 7
The error i get is User posted image
Member
Registered: Apr 2013
Posts: 7
I'll try to setup something where you can see it in action!
Member
Registered: Apr 2013
Posts: 7
Version 5.7.2 works fine if i specify loadPageOnClose:"self" but then it closes all floatbox if i open a new floatbox from a floatbox. I'll RTFM a bit more, sorry!
Administrator
Registered: Aug 2008
Posts: 3382
Well, the error message tells us what we want to know about whether 4.27 supported fb.showItem() or not. Apparently it didn't/doesn't/don't.

Looking forward to seeing the page...
Member
Registered: Apr 2013
Posts: 7
Could you give me a small tip on how i can close a floatbox without closing its parent floatbox?
Administrator
Registered: Aug 2008
Posts: 3382
I'm not being a smart-ass when I suggest that you take a gander at the API Reference. Everything there is to know about calling fb.end() and about addressing a specific floatbox when more than one is open is in there.

The short version is that fb.end() will close the top-most floatbox, as will fb.topInstance.end(). fb.lastInstance.end() will close the most recently opened box. fb.ownerInstance(this).end() will close the box that an onclick action occurred in. fb.getInstance('someName').end() will close an instance that was assigned 'someName' via the instanceName option. If floatbox.js is not included on the current page in an iframe, you may have to refer to parent.fb to execute these from the document where floatbox.js exists.

All support and linked documentation information pertains to the current version.
Member
Registered: Apr 2013
Posts: 7
Everything solved. removeScrollbars:false and loadPageOnClose removed behaves the way we want. From this friday the annual report 2012 of the National Aerospace Laboratory NLR of the Netherlands will be visible on http://annualreport.nlr.nl/ using floatbox 5.7.2 ;-)

Thanks for the amazingly fast and good support!

Page: 1