render() {
        this.clear()

        for (var i = 0; i < this.image_collection.length; i++) {
            var image = document.createElement('div')
            image.innerHTML = image.innerHTML + `
            <style>
            .gus_carousel_element {
                height: ${this.carousel.clientHeight}px;
                width: ${this.carousel.clientWidth}px;

                background-size: cover;
                background-position: center;

                margin-left: 0;
                transition: 0.4s;
            }
            .gus_carousel_element_inactive {
                margin-left: 0px;
                transition: 0.4s;
            }
            .gus_carousel_element_active {
                margin-left: -${this.carousel.clientWidth}px;
                transition: 0.4s;
            }
            </style>
            <div class="gus_carousel_element" style="background-image: url(${this.image_collection[i]});"></div>
            `
            if (i < this.actual_image) {
                image.classList.add("gus_carousel_element_active")
            }
            this.carousel.appendChild(image)

            
        }

        if (this.autoScroll) {
            this.autoScrollFunc = setInterval((e) => {
                this.nextImage()
            }, this.autoScrollDelay);
        }
        else {
            this.autoScrollFunc = null
        }

        if (this.hideArrows) {
            this.carousel_button_left.style.display = "none"
            this.carousel_button_right.style.display = "none"
        }
        else {
            this.carousel_button_left.style.display = "auto"
            this.carousel_button_right.style.display = "auto"
        }

        if (this.hideBar) {
            this.carousel_bar.style.display = "none"
        }
        else {
            this.carousel_bar.style.display = "auto"
        }
    }
// Re-render the whole carousel
Re-render the whole carousel
Re - render the whole carousel
render() {
        this.clear()
        for (var i = 0; i < this.image_collection.length; i++) {
            var image = document.createElement('div')
            image.innerHTML = image.innerHTML + `
            <style>
            .gus_carousel_element {
                height: ${this.carousel.clientHeight}px;
                width: ${this.carousel.clientWidth}px;
                background-size: cover;
                background-position: center;
                margin-left: 0;
                transition: 0.4s;
            }
            .gus_carousel_element_inactive {
                margin-left: 0px;
                transition: 0.4s;
            }
            .gus_carousel_element_active {
                margin-left: -${this.carousel.clientWidth}px;
                transition: 0.4s;
            }
            </style>
            <div class="gus_carousel_element" style="background-image: url(${this.image_collection[i]});"></div>
            `
            if (i < this.actual_image) {
                image.classList.add("gus_carousel_element_active")
            }
            this.carousel.appendChild(image)
        }
        if (this.autoScroll) {
            this.autoScrollFunc = setInterval((e) => {
                this.nextImage()
            }, this.autoScrollDelay);
        }
        else {
            this.autoScrollFunc = null
        }
        if (this.hideArrows) {
            this.carousel_button_left.style.display = "none"
            this.carousel_button_right.style.display = "none"
        }
        else {
            this.carousel_button_left.style.display = "auto"
            this.carousel_button_right.style.display = "auto"
        }
        if (this.hideBar) {
            this.carousel_bar.style.display = "none"
        }
        else {
            this.carousel_bar.style.display = "auto"
        }
    }
render ( ) { this . clear ( ) for ( var i = 0 ; i < this . image_collection . length ; i ++ ) { var image = document . createElement ( 'div' ) image . innerHTML = image . innerHTML + ` ${ this . carousel . clientHeight } ${ this . carousel . clientWidth } ${ this . carousel . clientWidth } ${ this . image_collection [ i ] } ` if ( i < this . actual_image ) { image . classList . add ( "gus_carousel_element_active" ) } this . carousel . appendChild ( image ) } if ( this . autoScroll ) { this . autoScrollFunc = setInterval ( ( e ) => { this . nextImage ( ) } , this . autoScrollDelay ) ; } else { this . autoScrollFunc = null } if ( this . hideArrows ) { this . carousel_button_left . style . display = "none" this . carousel_button_right . style . display = "none" } else { this . carousel_button_left . style . display = "auto" this . carousel_button_right . style . display = "auto" } if ( this . hideBar ) { this . carousel_bar . style . display = "none" } else { this . carousel_bar . style . display = "auto" } }
Re-render the whole carousel
Re - render the whole carousel