autoStart problem

Page: 1

Author Post
mio
Guest
I've updated floatbox from 3.24 to 3.30 and since then the option autoStart:true hasn't worked.

Link: http://mio.hozza.eu/pg/galeria/view/gallery/zajac.jpg
- this should run the first photo. (row 81)
« Last edit by Unknown on Tue Apr 14, 2009 1:08 pm. »
mio
Guest
it is a problem with onload function - when I run something in onload, floatbox doesn't autostart
mio
Guest
Solved!

I've added this code at the end of floatbox.js
function fbOnLoad(){
if (arguments.callee.done) return;
arguments.callee.done = true;
if (typeof fb_prevOnload === 'function') fb_prevOnload();
initfb();
(function() {
if (!self.fb) return setTimeout(arguments.callee, 50);
if (fb.autoStart) {
setTimeout ( function() { if (fb.start) fb.start(fb.autoStart); }, 200);
} else {
if (self.document === fb.doc) fb.preloadImages('', true);
}
})();
}


and I call the fbOnLoad function:
<body onload="fbOnLoad();">
Administrator
Registered: Aug 2008
Posts: 3382
I can't figure this one out and I can't reproduce it. autoStart works every time in my tests no matter how I mark up the anchor. I haven't given up yet. This evening I'll try to reproduce and solve the error by more closely replicating your page setup.

Two things to note here. The first is that I notice you changed your rel attributes to now use the class attribute. It's true the older versions of floatbox used the rel attribute for flagging content as floatbox-enabled, and the new version uses the class attribute. But the new version also recognizes the old-style rel and other attributes. When moving to v3.50+ from prior versions, it is NOT necessary to change your anchor markup in any way. It's fully backward compatable.

The second thing is that testing autoStart revealed a bug. When autoStarting an item that is part of a group, it will start as a single item and you can't navigate through the rest of the group. I'll work on that too.

Stay tuned...
Administrator
Registered: Aug 2008
Posts: 3382
I didn't see your subsequent posts when I posted my response, so things look a little out of sequence in this thread. So now when your item autoStarts, is it grouped correctly with the other gallery set members? Or is it "image 1 of 1"?

I'll see if I can improve the compatability with other onload functions.

Cheers...
mio
Guest
admin wrote
The first is that I notice you changed your rel attributes to now use the class attribute.

Yes, but I've tested it with rel and i thought that change from rel to class will help. It won't.
« Last edit by Unknown on Tue Apr 14, 2009 2:45 pm. »

Page: 1