How do I use the photoswipe script? I want to use photoswipe script on my site to preview images. I downloaded the script, copied two JS files code-photoswipe-1.0.11.min.js and simple-inheritance.min.js. Include them in a file theme.info:

scripts[] = js/code-photoswipe-1.0.11.min.js
scripts[] = js/simple-inheritance.min.js


Next, I overwrite template with image field:

&lt;div id="Gallery"&gt;
    &lt;div class="gallery-row"&gt;
        &lt;div class="gallery-item"&gt;
            &lt;?php print $output; ?&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


HTML generate this code:

&lt;div id="Gallery"&gt;
    &lt;div class="gallery-row"&gt;
        &lt;div class="gallery-item"&gt;
            &lt;a href="/node/36"&gt;
                &lt;img ..."&gt;
            &lt;/a&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


But nothing your working. What's wrong?
FireBug displays two errors:

Uncaught ReferenceError: SimpleClass is not defined       code-photoswipe-1.0.11.min.js:28
Uncaught TypeError: undefined is not a function                                       8:62
The order of includes should be reversed (as you did). There is also accompanying css file and the following initialization js code (see examples src http://github.com/downloads/dimsemenov/PhotoSwipe/code-photoswipe.v1.0.11.zip).

&lt;script type="text/javascript"&gt;

        // Set up PhotoSwipe with all anchor tags in the Gallery container 
        document.addEventListener('DOMContentLoaded', function(){

            Code.photoSwipe('a', '#Gallery');

        }, false);
&lt;/script&gt;