Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Galleria theme occasionally not loading

I am using the Galleria slideshow on my site, but I've noticed an error that seems to happen very randomly. Most of the time the slideshow loads correctrly but once in a while I get this error:

 Uncaught Error: Fatal error: Theme at javascript/themes/classic/galleria.classic.js
 could not load, check theme path.

When I reload the page, it's all back to normal. This is the code I'm using to load it:

  <script> 
        // Load the classic theme
   Galleria.loadTheme('javascript/themes/classic/galleria.classic.js');
    </script> 

I have searched around but still haven't found a solution that works. My personal idea was to have a script that keeps loading until it succeeds, since on reload the page works. How would I do this?

like image 737
odle Avatar asked May 30 '11 22:05

odle


3 Answers

1 Try the latest build at gihub: https://github.com/aino/galleria/blob/master/src/galleria.js

2 Try loading the theme using a script tag instead:

<script src="javascript/themes/classic/galleria.classic.js"></script>
like image 111
David Hellsing Avatar answered Nov 10 '22 21:11

David Hellsing


I adopted the method pointed out by David, loading the theme using a script tag:

<script src="javascript/themes/classic/galleria.classic.js"></script>

But was eventually getting another error (Fatal error: Theme CSS could not load after 20 sec). I'd also recommend adding the CSS using a link tag:

<link rel="stylesheet" type="text/css" href="galleria/themes/classic/galleria.classic.css" />
like image 33
Ivan Chaer Avatar answered Nov 10 '22 20:11

Ivan Chaer


I had a similar message today when I tried using Galleria. It happened only in Firefox. What I did to get around it is to add the theme stylesheet link directly in the head. I kept the theme script link in too, after the stylesheet, just in case it was needed. After that, the error message went away and Galleria is working as it should.

like image 1
Benny Jobigan Avatar answered Nov 10 '22 22:11

Benny Jobigan