fancyapps / fancybox

jQuery lightbox script for displaying images, videos and more. Touch enabled, responsive and fully customizable.
http://fancyapps.com/
7.28k stars 1.78k forks source link

showClass, hideClass and animated not working #2636

Closed raphaelparent closed 2 years ago

raphaelparent commented 2 years ago

Describe the bug I'm trying to change the showClass, hideClass and animated settings without success, meaning that the default animation is always visible. Event like "ready" and "close" are working well.

To Reproduce Steps to reproduce the behavior:

  1. Install fancybox v4.0.23 via npm
  2. Import the code with import { Fancybox } from '@fancyapps/ui';
  3. Import the css in SCSS with the following @import './node_modules/@fancyapps/ui/dist/fancybox.css';
  4. Use the static bind method to add some options to a specific selector.
document.addEventListener('DOMContentLoaded', function () {
    Fancybox.bind('.media__link', {
        showClass: false,
        hideClass: false,
        animated: false,
        on: {
            ready: (e) => {
                console.log(Fancybox.getInstance());
            }
        }
    });
});

Expected behavior The opening and closing of the fancybox is not animated.

Desktop:

fancyapps commented 2 years ago

Hi,

I wonder what is causing you misunderstanding, because everything works as expected, demo - https://fancyapps.com/playground/20d

You did not say what type of content you are having and you did not provide a live demo, so I assume you tried to disable image zooming, right? You have to set Image: { zoom: false } for that.

btw, there is no need for document.addEventListener('DOMContentLoaded', function () {}, because the script does not add click events directly to DOM elements, but uses event delegation.

raphaelparent commented 2 years ago

I'd be fun to have a chance to answer before closing. I filled up the default issue description like mentioned and I would've been happy to provide more information. Somehow though, this morning it's working so I guess everything is fine.

fancyapps commented 2 years ago

@raphaelparent Actually, you should use https://github.com/fancyapps/ui repository for the latest Fanybox and you can discuss here - https://github.com/fancyapps/ui/discussions (Sorry, I haven't found time to post migration notification and put this repository in read-only mode).