codecomputerlove/PhotoSwipe — Issue #256: Error in Source Code
Author: lukejamestaylor
Created: 2012-02-07 14:21:43+00:00
State: open

Hello!

There is an error in the source code on roughly line 5673 of the code.photoswipe.jquery-3.0.4.js.

Where you remove the ps-active class, you don't check whether the user has set a custom target and try to remove it from the body by default.

Replace this with:

var el = (this.settings.target === window) ? window.document.body : this.settings.target;

Util.DOM.removeClass(el, PhotoSwipe.CssClasses.activeBody);

and it works a treat.

Thank you, keep up the good work!
Luke