Home > Blockchain >  div not showing when changing style in javascript
div not showing when changing style in javascript

Time:10-24

I'm trying to simply change the display property of a couple of elements when a link is hovered over, the elements default display in none. Here is the relevant code. I've removed the svg content as it takes up too much characters. Thankyou!

class LinkContainer {
    animating = false;
    alias;
    colours;
    link;
    textelements;
    shown;

    constructor(alias, link, colours, textelements) {
        this.alias = alias
        this.colours = colours;
        this.link = link;
        textelements == null ? this.textelements = [] : this.textelements = Array.from(textelements)
        console.log(this.textelements)
        // this.textelements.forEach((element) => {
        //     element.Hide;
        // });
    }

    toggletextelements(state) {
        if (this.textelements.length == 0)
            return

        if (state) {
            // let t1 = TimelineMax();
            let transition = false;
            linkcontainers.forEach((container) => {
                // console.log(container.shown && container.alias != this.alias);
                if (container.shown && container.alias != this.alias) {
                    const tween = KUTE.fromTo(
                        `.${this.alias} svg`,
                        { path: `.${this.alias} svg` },
                        { path: `.${container.alias} svg` },
                    ).start();
                    this.shown = true;
                } else {
                    // $(this.textelements[0]).show();
                    // console.log("           
  • Related