Search code examples
jqueryjquery-pluginscolorbox

Colorbox issue on Android


I've noticed an issue with Colorbox on Android, where the colorbox popup just hangs with the loading graphic, then if you click to close it, you momentarily see the content (which should have been displayed) in a colorbox popup underneath, then both popups close.

I checked the official demo on the site and found the same issue i was experiencing on my own site. The phone I've had the issue on is an HTC Desire running Android Ice Cream Sandwich. The issue doesn't happen with iOS or on Blackberry, seems to be just a weird Android glitch.

Grateful for any help finding a workaround. Mainly flagging this up here as the Colorbox Google Group has been closed.


Solution

  • It seems the loading overlay does not get hidden properly after it's done. Luckily that's an easy fix by using the onComplete callback:

    $(document).ready(function()
    {
        $('a.colorbox').colorbox({
            onComplete: function()
            {
                $('#cboxLoadingOverlay, #cboxLoadingGraphic').hide();
            }
        });
    });
    

    This makes sure the loadingOverlay is hidden properly after usage. Colorbox itself will take care of it being reshown. This resolved the issue for my devices.

    Let met know if this worked for you too.