close() {
        if (!this.lightboxOpen) {
            if (this.events) {
                for (let key in this.events) {
                    if (this.events.hasOwnProperty(key)) {
                        this.events[key].destroy();
                    }
                }
                this.events = null;
            }
            return false;
        }

        if (this.closing) {
            return false;
        }
        this.closing = true;
        this.slidePlayerPause(this.activeSlide);

        if (this.fullElementsList) {
            this.elements = this.fullElementsList;
        }

        if (this.bodyHiddenChildElms.length) {
            _.each(this.bodyHiddenChildElms, (el) => {
                el.removeAttribute('aria-hidden');
            });
        }

        _.addClass(this.modal, 'glightbox-closing');
        _.animateElement(this.overlay, this.settings.openEffect == 'none' ? 'none' : this.settings.cssEfects.fade.out);
        _.animateElement(this.activeSlide, this.settings.cssEfects[this.settings.closeEffect].out, () => {
            this.activeSlide = null;
            this.prevActiveSlideIndex = null;
            this.prevActiveSlide = null;
            this.built = false;

            if (this.events) {
                for (let key in this.events) {
                    if (this.events.hasOwnProperty(key)) {
                        this.events[key].destroy();
                    }
                }
                this.events = null;
            }

            const body = document.body;
            _.removeClass(html, 'glightbox-open');
            _.removeClass(body, 'glightbox-open touching gdesc-open glightbox-touch glightbox-mobile gscrollbar-fixer');
            this.modal.parentNode.removeChild(this.modal);

            this.trigger('close');

            // settings.onClose is deprecated and will be removed in a future update
            if (_.isFunction(this.settings.onClose)) {
                this.settings.onClose();
            }

            const styles = document.querySelector('.gcss-styles');
            if (styles) {
                styles.parentNode.removeChild(styles);
            }
            this.lightboxOpen = false;
            this.closing = null;
        });
    }
Close Lightbox
closes the lightbox and removes the slides
and some classes