fb is undefined - IE7

Page: 1

Author Post
Vylda
Guest
Hi,

Floatbox is great script, but I still have a problem: when I can run Floatbox when page is loaded, all my browsers are good. Only IE7 say: 'fb' is undefined and Float box not running. When I try create clasicc anchor, everything is OK. When I use fb.loadAnchor, IE7 is not show floatbox. You can tray it:

http://sk.nicom.cz/test.html

I'm using onload in body element (so, when I tray it on img element, erorr is here too).

Where is problem?

Thanks
Administrator
Registered: Aug 2008
Posts: 3382
In IE, body.onload is firing before the floatbox code is loaded. That's a fixable problem. What you are trying to do with the onload function is auto-start the floatbox display. To do this, never mind body.onload, just add "autoStart:true" to the rev attribute.

I notice your rev attribute currently is rev="type:img". You don't need this type option here because the file type is .jpg and floatbox already knows that that's an image. So delete your body onload function and change your rev tag to rev="autoStart:true".
Vylda
Guest
well, but I don't have any anchor for autoStart:True. I have a blank page.
See?
How can I run script?
Administrator
Registered: Aug 2008
Posts: 3382
Uncomment your anchor.

<!--
<a href="/images/kontakty-praha-3.jpg" rel="floatbox" rev="autoStart:true">click</a>
-->

If you don't want anything displayed on the page, remove the word "click" from the anchor.
Vylda
Guest
Well :-) Thanks...
Vylda
Guest
so, I need start this scrip via another script with cookie tracking.
like: if (cookie) {fb.loadAnchor} - it is simple example. Is it possible?
Vylda
Guest
I find it:
document.getElementById("test").innerHTML = &#039;<a href="/images/kontakty-praha-3.jpg" rel="floatbox" rev="autoStart:true" style="display:none"></a>&#039;


Thanks
Administrator
Registered: Aug 2008
Posts: 3382
fb.loadAnchor(&#039;/images/kontakty-praha-3.jpg&#039;);

I strongly recommend you take the time to read the docs to learn how to configure and use floatbox. It's pretty easy if you pay attention to the instructions.

Page: 1