Search code examples
javascriptjquerycolorbox

Add Loading Text to Colorbox Plugin


For the Colorbox jQuery plugin (found here):

I know there is a loading graphic for colorbox (set as the background of the #LoadingGraphic div), but how can I get text to appear below the loading graphic?


Solution

  • This might not be the most ideal but it looks like it works. Check out this fiddle

    When you initialize the Colorbox plugin, the loadingdiv will be created but hidden. You could append a div inside of it and give it some styles.

    $(".group1").colorbox({rel:'group1'});
    $("#cboxLoadingOverlay").append("<div class='loading-text'>My Loading Text</div>")
    

    CSS

    .loading-text{margin-top:50px; font-weight:bold; font-family:arial; font-size:20px}