"Uncaught TypeError: Cannot read property 'PhotoSwipe' of undefined" #509

LAMike310 opened this Issue Mar 19, 2013 · 1 comment


None yet

3 participants


Can someone take a look at my code and see if they can help me out?

I am using Foundation with PhotoSwipe, and the slideshow won't appear for some reason.

It keeps throwing me an error that says, "Uncaught TypeError: Cannot read property 'PhotoSwipe' of undefined "


Thanks for any help,



Did you try setting it up as presented on the site? I have just set it up and it works fine.

// Set up PhotoSwipe with all anchor tags in the Gallery container
document.addEventListener('DOMContentLoaded', function(){
    var myPhotoSwipe = Code.PhotoSwipe.attach( window.document.querySelectorAll('#Gallery a'), { enableMouseWheel: false , enableKeyboard: false } );
}, false);

The code you have in your JS calls Code on window and window does not have such property.

@dimsemenov dimsemenov closed this Dec 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment