Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can I enable Open and Close effect like Photoswipe.com Demo page ? #48

Open
NghiaMaster opened this issue Jul 4, 2019 · 3 comments
Open

Comments

@NghiaMaster
Copy link

https://codepen.io/dimsemenov/pen/ZYbPJM

@ibrahim-sowunmi
Copy link

I would also like to know this

@Darthagnon
Copy link

Relevant part of Photoswipe documentation: https://photoswipe.com/opening-or-closing-transition/

I've noticed, too, how the animation is wrong.

@Darthagnon
Copy link

I tried adding showHideAnimationType: 'zoom' to load-photoswipe.js without any success:

      // Save the index of this image then add it to the array
        items.push(item);
        // Event handler for click on a figure
        $figure.addEventListener('click', function(event) {
            event.preventDefault();  // prevent the normal behaviour i.e. load the <a> hyperlink
            // Get the PSWP element and initialize it with the desired options
            var $pswp = document.querySelector('.pswp');
            var options = {
                index: index,
                bgOpacity: 0.8,
                showHideOpacity: true,
                showHideAnimationType: 'zoom',
                focus: 'false',
                history: 'false'
            }
            new PhotoSwipe($pswp, PhotoSwipeUI_Default, items, options).init();
        }, false);
    });
}, false);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants