flash appears on new page if i click before page is fully loaded

Page: 1

Author Post
johnreitano
Guest
Hi,

If I load a page, and then click on one of my floatbox links I get the picture displayed on a new web page instead of in a popup.

This happens in IE6 and IE7, not Firefox. It only happens if I click on the link immediately after the page has started to load, but before it has completed loading.

You can see the behaviour, by clicking on one of the thumbnails labeled "Images" or "Videos" on the page at http://www.soundcastsystems.com/products/outcast

Any idea how to fix this?

Thanks,
John
Administrator
Registered: Aug 2008
Posts: 3382
Floatbox loads as early as it can based on DOM readiness, and does not wait for onload to fire. But you're quite right, there's a small window of time between when the browser allows clicks and when the DOM is fully loaded. IE seems to be the most liberal at responding to clicks before the document is fully present. This is a problem for all javascript that adds behaviours to anchor clicks, not just for floatbox.

You can't beat it, but you can trick it. :P
It's a bit of a pain, but if you really want to block early clicks you can do so by adding an onclick function to each of your floatbox-enabled anchors. The simple version adds onclick="return false;" to each anchor. This simply blocks the click action and nothing will happen when the user clicks the anchor. The slightly more complicated version adds onclick="this.rev += ' autoStart:true'; return false;". This appends an autoStart request to the clicked anchor so that when floatbox does initialize, it will launch the clicked item.

What makes this work is that once the document is loaded, floatbox replaces these manually added onclick actions with its own startup code.
Administrator
Registered: Aug 2008
Posts: 3382
Version 3.23 is now available.
It has much better early loading for IE and goes a long way to eliminating the problem discussed in this thread.
Member
Registered: Nov 2008
Posts: 26
:shock: Wow, every week a new version. Respect! Thx
Administrator
Registered: Aug 2008
Posts: 3382
Just trying to keep up with the small bug fixes. I don't like having the current version sit with known bugs for too long. v3.23 may well be it for some time. Real soon now I'm going traveling for a couple of months.

Page: 1