enableGallery() {

        const self = this;

        const nextTrigger = document.querySelectorAll("[data-next]");
        const prevTrigger = document.querySelectorAll("[data-prev]");

        // Next Image
        for (const nxt of nextTrigger) {
            nxt.addEventListener("click", function () {
                self.imageData = self.cycleImage('next');
            });
        }

        // Previous image
        for (const prev of prevTrigger) {
            prev.addEventListener("click", function () {
                self.imageData = self.cycleImage('prev');
            });
        }

        // Pressing Right key to skip to next
        for (const nxt of nextTrigger) {
            document.addEventListener("keyup", e => {
                if (e.key === "ArrowRight" && document.querySelector(`.${self.isVisible}`)) {
                    self.imageData = self.cycleImage('next');
                }
            });
        }

        // Pressing Left key to skip to previous
        for (const nxt of nextTrigger) {
            document.addEventListener("keyup", e => {
                if (e.key === "ArrowLeft" && document.querySelector(`.${self.isVisible}`)) {
                    self.imageData = self.cycleImage('prev');
                }
            });
        }
    }
/**
     * Enable Gallery
     * Next, Previous image by click or keys
     */
Enable Gallery
Next, Previous image by click or keys
Enable Gallery Next Previous image by click or keys
enableGallery() {
        const self = this;
        const nextTrigger = document.querySelectorAll("[data-next]");
        const prevTrigger = document.querySelectorAll("[data-prev]");
        for (const nxt of nextTrigger) {
            nxt.addEventListener("click", function () {
                self.imageData = self.cycleImage('next');
            });
        }
        for (const prev of prevTrigger) {
            prev.addEventListener("click", function () {
                self.imageData = self.cycleImage('prev');
            });
        }
        for (const nxt of nextTrigger) {
            document.addEventListener("keyup", e => {
                if (e.key === "ArrowRight" && document.querySelector(`.${self.isVisible}`)) {
                    self.imageData = self.cycleImage('next');
                }
            });
        }
        for (const nxt of nextTrigger) {
            document.addEventListener("keyup", e => {
                if (e.key === "ArrowLeft" && document.querySelector(`.${self.isVisible}`)) {
                    self.imageData = self.cycleImage('prev');
                }
            });
        }
    }
enableGallery ( ) { const self = this ; const nextTrigger = document . querySelectorAll ( "[data-next]" ) ; const prevTrigger = document . querySelectorAll ( "[data-prev]" ) ; for ( const nxt of nextTrigger ) { nxt . addEventListener ( "click" , function ( ) { self . imageData = self . cycleImage ( 'next' ) ; } ) ; } for ( const prev of prevTrigger ) { prev . addEventListener ( "click" , function ( ) { self . imageData = self . cycleImage ( 'prev' ) ; } ) ; } for ( const nxt of nextTrigger ) { document . addEventListener ( "keyup" , e => { if ( e . key === "ArrowRight" && document . querySelector ( ` ${ self . isVisible } ` ) ) { self . imageData = self . cycleImage ( 'next' ) ; } } ) ; } for ( const nxt of nextTrigger ) { document . addEventListener ( "keyup" , e => { if ( e . key === "ArrowLeft" && document . querySelector ( ` ${ self . isVisible } ` ) ) { self . imageData = self . cycleImage ( 'prev' ) ; } } ) ; } }
Enable Gallery
 Next, Previous image by click or keys
Enable Gallery Next Previous image by click or keys
// Next Image // Previous image // Pressing Right key to skip to next // Pressing Left key to skip to previous